public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed
@ 2005-05-02 19:55 jsm28 at gcc dot gnu dot org
  2005-05-02 20:00 ` [Bug c/21342] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-05-02 19:55 UTC (permalink / raw)
  To: gcc-bugs

My fix to bug 13801 caused some cases of incompatible declarations with external
linkage (in different scopes) not to be diagnosed.  pushdecl fails to update the
type in the external scope with the new information from the new declaration if
there was already a declaration in the current scope, or to check for
consistency with the type in the external scope in those circumstances.

Test 1:

int f(int (*)[]);
int g() { int f(int (*)[2]); }
int f(int (*)[3]);

Test 2:

extern int a[];
void f(void) { extern int a[]; extern int a[10]; }
extern int a[5];

Test 3:

extern int a[];
void f(void) { extern int a[10]; }
extern int a[5];

-- 
           Summary: [4.0/4.1 Regression] some incompatible external
                    declarations not diagnosed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
@ 2005-05-02 20:00 ` pinskia at gcc dot gnu dot org
  2005-05-10 12:38 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-02 20:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-02 20:00 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-02 20:00:40
               date|                            |
   Target Milestone|---                         |4.0.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
  2005-05-02 20:00 ` [Bug c/21342] " pinskia at gcc dot gnu dot org
@ 2005-05-10 12:38 ` cvs-commit at gcc dot gnu dot org
  2005-05-10 12:41 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-10 12:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-10 12:38 -------
Subject: Bug 21342

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2005-05-10 12:38:35

Modified files:
	gcc            : ChangeLog c-decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: redecl-11.c redecl-12.c redecl-13.c 
	                      redecl-14.c redecl-15.c 

Log message:
	PR c/21342
	* c-decl.c (pushdecl): When there is a declaration in the current
	scope and the declarations are external linkage, check for
	compatibility with the type in the external scope and update the
	type in the external scope with the composite type information.
	Do not form a composite type of the new type and the visible type
	if they are incompatible.
	
	testsuite:
	* gcc.dg/redecl-11.c, gcc.dg/redecl-12.c, gcc.dg/redecl-13.c,
	gcc.dg/redecl-14.c, gcc.dg/redecl-15.c: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8703&r2=2.8704
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.652&r2=1.653
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5454&r2=1.5455
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-11.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-12.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-13.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-14.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-15.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
  2005-05-02 20:00 ` [Bug c/21342] " pinskia at gcc dot gnu dot org
  2005-05-10 12:38 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-10 12:41 ` cvs-commit at gcc dot gnu dot org
  2005-05-10 16:41 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-10 12:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-10 12:41 -------
Subject: Bug 21342

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jsm28@gcc.gnu.org	2005-05-10 12:41:28

Modified files:
	gcc            : ChangeLog c-decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: redecl-11.c redecl-12.c redecl-13.c 
	                      redecl-14.c redecl-15.c 

Log message:
	PR c/21342
	* c-decl.c (pushdecl): When there is a declaration in the current
	scope and the declarations are external linkage, check for
	compatibility with the type in the external scope and update the
	type in the external scope with the composite type information.
	Do not form a composite type of the new type and the visible type
	if they are incompatible.
	
	testsuite:
	* gcc.dg/redecl-11.c, gcc.dg/redecl-12.c, gcc.dg/redecl-13.c,
	gcc.dg/redecl-14.c, gcc.dg/redecl-15.c: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.236&r2=2.7592.2.237
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.630.6.9&r2=1.630.6.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.167&r2=1.5084.2.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-11.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-12.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-13.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-14.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-15.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-05-10 12:41 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-10 16:41 ` pinskia at gcc dot gnu dot org
  2005-05-11 10:18 ` schwab at suse dot de
  2005-05-11 10:50 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-10 16:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-10 16:41 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-05-10 16:41 ` pinskia at gcc dot gnu dot org
@ 2005-05-11 10:18 ` schwab at suse dot de
  2005-05-11 10:50 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: schwab at suse dot de @ 2005-05-11 10:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2005-05-11 10:18 -------
This is causing a regression on ia64: 
 
stage1/xgcc -Bstage1/ -B/usr/local/ia64-suse-linux/bin/   
-DUSE_LIBUNWIND_EXCEPTIONS -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings 
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long 
-Wno-variadic-macros -Wold-style-definition     -DHAVE_CONFIG_H  -o cc1 \ 
	c-parse.o c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o 
c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o 
c-semantics.o c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o 
c-objc-common.o c-dump.o c-pch.o  c-gimplify.o tree-mudflap.o c-pretty-print.o 
main.o  
libbackend.a ../libcpp/libcpp.a ../libcpp/libcpp.a   ../libiberty/libiberty.a 
libbackend.a(stringpool.o): In function `ggc_alloc_string': 
../../gcc/stringpool.c:91: relocation truncated to fit: GPREL22 against symbol 
`empty_string' defined in .rodata section in libbackend.a(stringpool.o) 
/usr/bin/ld: final link failed: Nonrepresentable section on output 
collect2: ld returned 1 exit status 
make[2]: *** [cc1] Error 1 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schwab at suse dot de
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/21342] [4.0/4.1 Regression] some incompatible external declarations not diagnosed
  2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-05-11 10:18 ` schwab at suse dot de
@ 2005-05-11 10:50 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-11 10:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-11 10:50 -------
(In reply to comment #5)
> This is causing a regression on ia64: 
>  
> ../../gcc/stringpool.c:91: relocation truncated to fit: GPREL22 against symbol 
> `empty_string' defined in .rodata section in libbackend.a(stringpool.o) 
> /usr/bin/ld: final link failed: Nonrepresentable section on output 

I think this was fixed by PR 21502.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21342


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-05-11 10:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 19:55 [Bug c/21342] New: [4.0/4.1 Regression] some incompatible external declarations not diagnosed jsm28 at gcc dot gnu dot org
2005-05-02 20:00 ` [Bug c/21342] " pinskia at gcc dot gnu dot org
2005-05-10 12:38 ` cvs-commit at gcc dot gnu dot org
2005-05-10 12:41 ` cvs-commit at gcc dot gnu dot org
2005-05-10 16:41 ` pinskia at gcc dot gnu dot org
2005-05-11 10:18 ` schwab at suse dot de
2005-05-11 10:50 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).