public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2
@ 2005-05-19  0:42 flash at pobox dot com
  2005-05-19  1:20 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: flash at pobox dot com @ 2005-05-19  0:42 UTC (permalink / raw)
  To: gcc-bugs

Compiling the C Torture file "weak-6.c" (below) gives an error at O0 and O1, as seemed to be expected 
by the author.  At O2, there's no error or warning.

214> gcc -O2 -c ../c/noerror/GPL/3.3.2/nowarn/bulk/gcc.dg/weak/weak-6.c
<no error>

215> gcc -O1 -c ../c/noerror/GPL/3.3.2/nowarn/bulk/gcc.dg/weak/weak-6.c
../c/noerror/GPL/3.3.2/nowarn/bulk/gcc.dg/weak/weak-6.c:4: error: weak declaration of `foo' must 
precede definition


weak-6.c:
/* { dg-do compile } */

extern void * foo (void);
void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */

#pragma weak foo

Also occurs with arm-softfloat-linux-gnu-g++ 3.4.1.
With Apple gcc version 3.3, I don't get the error at any optimization level.

____________________________________

Here's the save-temps output:


225> gcc -v -save-temps -O2 -c ../c/noerror/GPL/3.3.2/nowarn/bulk/gcc.dg/weak/weak-6.c
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.4/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --
infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --
disable-checking --libdir=/usr/lib --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-
slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.4 (pre 3.3.5 20040809)
 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/cc1 -E -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 
-D__GNUC_PATCHLEVEL__=4 ../c/noerror/GPL/3.3.2/nowarn/bulk/gcc.dg/weak/weak-6.c -O2 weak
-6.i
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include
 /usr/i586-suse-linux/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/cc1 -fpreprocessed weak-6.i -quiet -dumpbase weak-6.c 
-auxbase weak-6 -O2 -version -o weak-6.s
GNU C version 3.3.4 (pre 3.3.5 20040809) (i586-suse-linux)
        compiled by GNU C version 3.3.4 (pre 3.3.5 20040809).
GGC heuristics: --param ggc-min-expand=81 --param ggc-min-heapsize=96968
 /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/as -V -Qy -o weak-6.o weak
-6.s
GNU assembler version 2.15.91.0.2 (i586-suse-linux) using BFD version 2.15.91.0.2 20040727 (SuSE 
Linux)

-- 
           Summary: "weak declaration must precede definition" error missing
                    at >= O2
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: flash at pobox dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O2
  2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
@ 2005-05-19  1:20 ` pinskia at gcc dot gnu dot org
  2005-05-19 17:24 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-19  1:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-19 01:19 -------
Confirmed, unit-at-a-time related.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid, diagnostic
      Known to fail|                            |3.4.0 4.0.0 4.1.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-19 01:19:55
               date|                            |
            Summary|"weak declaration must      |[3.4/4.0/4.1 Regression]
                   |precede definition" error   |[unit-at-a-time] "weak
                   |missing at >= O2            |declaration must precede
                   |                            |definition" error missing at
                   |                            |>= O2
   Target Milestone|---                         |3.4.4


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O2
  2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
  2005-05-19  1:20 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
@ 2005-05-19 17:24 ` mmitchel at gcc dot gnu dot org
  2005-07-01 19:51 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1 pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1
  2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
  2005-05-19  1:20 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
  2005-05-19 17:24 ` mmitchel at gcc dot gnu dot org
@ 2005-07-01 19:51 ` pinskia at gcc dot gnu dot org
  2005-07-22 22:08 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-01 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-01 19:50 -------
: Search converges between 2003-09-04-trunk (#342) and 2003-09-05-trunk (#343).
That is at -O2,  -O3 we always accepted the code.

-- 


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1
  2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
                   ` (2 preceding siblings ...)
  2005-07-01 19:51 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1 pinskia at gcc dot gnu dot org
@ 2005-07-22 22:08 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 22:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 21:12 -------
Moving to 4.0.2 pre Mark.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1
  2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
                   ` (3 preceding siblings ...)
  2005-07-22 22:08 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:02 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1
       [not found] <bug-21659-8581@http.gcc.gnu.org/bugzilla/>
@ 2005-10-31  3:38 ` mmitchel at gcc dot gnu dot org
  0 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-31  3:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2005-10-31 03:38 -------
This will never be release-critical.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


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


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

end of thread, other threads:[~2005-10-31  3:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-19  0:42 [Bug c/21659] New: "weak declaration must precede definition" error missing at >= O2 flash at pobox dot com
2005-05-19  1:20 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
2005-05-19 17:24 ` mmitchel at gcc dot gnu dot org
2005-07-01 19:51 ` [Bug c/21659] [3.4/4.0/4.1 Regression] [unit-at-a-time] "weak declaration must precede definition" error missing at >= O1 pinskia at gcc dot gnu dot org
2005-07-22 22:08 ` pinskia at gcc dot gnu dot org
2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-21659-8581@http.gcc.gnu.org/bugzilla/>
2005-10-31  3:38 ` mmitchel 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).