+2009-06-19 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline:
+ 2009-01-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39013
+ * c-decl.c (pop_scope): Set DECL_EXTERNAL for functions declared
+ inline but never defined.
+
+ 2009-04-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39855
+ * fold-const.c (fold_binary) <case LSHIFT_EXPR>: When optimizing
+ into 0, use omit_one_operand.
+
2009-06-18 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
error ("nested function %q+D declared but never defined", p);
undef_nested_function = true;
}
- /* C99 6.7.4p6: "a function with external linkage... declared
- with an inline function specifier ... shall also be defined in the
- same translation unit." */
else if (DECL_DECLARED_INLINE_P (p)
&& TREE_PUBLIC (p)
- && !DECL_INITIAL (p)
- && !flag_gnu89_inline)
- pedwarn ("inline function %q+D declared but never defined", p);
+ && !DECL_INITIAL (p))
+ {
+ /* C99 6.7.4p6: "a function with external linkage... declared
+ with an inline function specifier ... shall also be defined
+ in the same translation unit." */
+ if (!flag_gnu89_inline)
+ pedwarn ("inline function %q+D declared but never defined", p);
+ DECL_EXTERNAL (p) = 1;
+ }
goto common_symbol;
if (code == LROTATE_EXPR || code == RROTATE_EXPR)
low = low % TYPE_PRECISION (type);
else if (TYPE_UNSIGNED (type) || code == LSHIFT_EXPR)
- return build_int_cst (type, 0);
+ return omit_one_operand (type, build_int_cst (type, 0),
+ TREE_OPERAND (arg0, 0));
else
low = TYPE_PRECISION (type) - 1;
}
+2009-06-19 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline:
+ 2009-01-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39013
+ * gcc.target/i386/pr39013-1.c: New test.
+ * gcc.target/i386/pr39013-2.c: New test.
+
+ 2009-04-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39855
+ * gcc.dg/torture/pr39855.c: New test.
+
2009-06-18 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
--- /dev/null
+/* PR c/39855 */
+/* { dg-do run { target { int32plus } } } */
+
+extern void abort (void);
+
+int i, j, k;
+
+int
+foo (void)
+{
+ return ++i;
+}
+
+int
+main ()
+{
+ if (__CHAR_BIT__ != 8 || sizeof (int) != 4)
+ return 0;
+ j = foo () << 30 << 2;
+ k = (unsigned) foo () >> 16 >> 16;
+ if (i != 2 || j != 0 || k != 0)
+ abort ();
+ return 0;
+}
--- /dev/null
+/* PR target/39013 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpie -std=gnu89" } */
+
+inline int foo (void);
+extern inline int bar (void);
+
+int
+main (void)
+{
+ return foo () + bar ();
+}
+
+/* { dg-final { scan-assembler "foo@PLT" } } */
+/* { dg-final { scan-assembler "bar@PLT" } } */
--- /dev/null
+/* PR target/39013 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpie -std=gnu99" } */
+
+inline int foo (void); /* { dg-warning "declared but never defined" } */
+extern inline int bar (void); /* { dg-warning "declared but never defined" } */
+
+int
+main (void)
+{
+ return foo () + bar ();
+}
+
+/* { dg-final { scan-assembler "foo@PLT" } } */
+/* { dg-final { scan-assembler "bar@PLT" } } */