* c-typeck.c (c_finish_return): Handle POINTER_PLUS_EXPR the same way
as PLUS_EXPR.
* gcc.dg/pr38957.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143654
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-01-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/38957
+ * c-typeck.c (c_finish_return): Handle POINTER_PLUS_EXPR the same way
+ as PLUS_EXPR.
+
2009-01-24 Julian Brown <julian@codesourcery.com>
* config/arm/t-linux-eabi (LIB2FUNCS_STATIC_EXTRA): Add
{
switch (TREE_CODE (inner))
{
- CASE_CONVERT: case NON_LVALUE_EXPR:
+ CASE_CONVERT:
+ case NON_LVALUE_EXPR:
case PLUS_EXPR:
+ case POINTER_PLUS_EXPR:
inner = TREE_OPERAND (inner, 0);
continue;
-2009-01-24 David Billinghurst (billingd@gcc.gnu.org)
+2009-01-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/38957
+ * gcc.dg/pr38957.c: New test.
+
+2009-01-24 David Billinghurst <billingd@gcc.gnu.org>
PR fortran/38955
* gfortran.dg/array_constructor_24.f: Allow tolerance when
- comparing floats
+ comparing floats.
2009-01-24 Sebastian Pop <sebastian.pop@amd.com>
--- /dev/null
+/* PR c/38957 */
+/* { dg-do compile } */
+
+char *
+foo (void)
+{
+ char a[2];
+ return a+1; /* { dg-warning "returns address of local variable" } */
+}
+
+char *
+bar (void)
+{
+ char a[2];
+ return a; /* { dg-warning "returns address of local variable" } */
+}