Commit c2d47482 by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

re PR target/49551 (tentative declaration after definition and -fdata-sections…

re PR target/49551 (tentative declaration after definition and -fdata-sections cause ICE in C front-end.)

2015-06-02  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

        PR c/49551
        * c-decl.c (merge_decls): Merge DECL_COMMON.
        * gcc.dg/pr49551.c: New test-case.

From-SVN: r224033
parent 4526c3c1
2015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/49551
* c-decl.c (merge_decls): Merge DECL_COMMON.
2015-05-22 Jim Wilson <jim.wilson@linaro.org>
* Make-lang.in (check_gcc_pallelize): Define.
......
......@@ -2631,6 +2631,12 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
else if (DECL_PRESERVE_P (newdecl))
DECL_PRESERVE_P (olddecl) = 1;
/* Merge DECL_COMMON */
if (VAR_P (olddecl) && VAR_P (newdecl)
&& !lookup_attribute ("common", DECL_ATTRIBUTES (newdecl))
&& !lookup_attribute ("nocommon", DECL_ATTRIBUTES (newdecl)))
DECL_COMMON (newdecl) = DECL_COMMON (newdecl) && DECL_COMMON (olddecl);
/* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
But preserve OLDDECL's DECL_UID, DECL_CONTEXT and
DECL_ARGUMENTS (if appropriate). */
......
2015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/49551
* gcc.dg/pr49551.c: New testcase.
2015-06-02 Richard Biener <rguenther@suse.de>
PR debug/65549
......
/* { dg-do compile } */
/* { dg-options "-O -fdata-sections" } */
int x = 1;
int x;
/* { dg-final { scan-assembler-not {comm[\t ]+x} } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment