Patchwork [committed] Add testcase from PR56992

login
register
mail settings
Submitter Jakub Jelinek
Date April 18, 2013, 6:32 a.m.
Message ID <20130418063229.GW12880@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/237439/
State New
Headers show

Comments

Jakub Jelinek - April 18, 2013, 6:32 a.m.
Hi!

This is a testcase that got fixed already by Andreas'
http://gcc.gnu.org/r197839 resp. r197840 commits, but as it lacked a
testcase, I'm adding one that reproduces it on 4.8 branch on x86_64-linux.

Committed as obvious.

2013-04-18  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/56992
	* gcc.dg/pr56992.c: New test.


	Jakub

Patch

--- gcc/testsuite/gcc.dg/pr56992.c.jj	2013-04-18 08:23:22.817099346 +0200
+++ gcc/testsuite/gcc.dg/pr56992.c	2013-04-18 08:25:56.353255131 +0200
@@ -0,0 +1,18 @@ 
+/* PR rtl-optimization/56992 */
+/* { dg-do compile } */
+/* { dg-options "-Og -g" } */
+
+inline int
+foo (const char *x)
+{
+  return __builtin_strlen (x);
+}
+
+int
+bar (const char *x, unsigned int *y)
+{
+  unsigned int l = foo (x);
+  if (l > 15)
+    l = 15;
+  *y = l;
+}