public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27657]  New: [4.2 regression] bogus undefined reference error to static var with -g and -O
@ 2006-05-18 13:35 tbm at cyrius dot com
  2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: tbm at cyrius dot com @ 2006-05-18 13:35 UTC (permalink / raw)
  To: gcc-bugs

I get an "undefined reference" error when linking two files but that variable
is static.  This only happens with gcc 4.2, and only when I enable both -g and
-O1 (or higher).

(sid)473:tbm@reyes: ~] cat test.c
static const char utf8_skip_data[1] = {1};
static const char * const gconf_g_utf8_skip = utf8_skip_data;
(sid)474:tbm@reyes: ~] cat main.c
int main() {
}
(sid)475:tbm@reyes: ~] gcc -c -o main.o main.c
(sid)476:tbm@reyes: ~] gcc -c -g -O2 -o test.o test.c
(sid)477:tbm@reyes: ~] gcc main.o test.o
test.o:(.debug_info+0x93): undefined reference to `utf8_skip_data'
collect2: ld returned 1 exit status
zsh: exit 1     gcc main.o test.o
(sid)478:tbm@reyes: ~] gcc-4.1 -c -g -O2 -o test.o test.c
(sid)479:tbm@reyes: ~] gcc main.o test.o
(sid)480:tbm@reyes: ~] gcc -c -g -O0 -o test.o test.c
(sid)481:tbm@reyes: ~] gcc main.o test.o
(sid)482:tbm@reyes: ~]

This is with 4.2.0 20060419.  20060517 shows the same.


-- 
           Summary: [4.2 regression] bogus undefined reference error to
                    static var with -g and -O
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com
 GCC build triplet: powerpc-linux-gnu
  GCC host triplet: powerpc-linux-gnu
GCC target triplet: powerpc-linux-gnu


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


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

end of thread, other threads:[~2007-02-04 17:52 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
2006-05-29  3:07 ` amodra at bigpond dot net dot au
2006-06-04 19:13 ` mmitchel at gcc dot gnu dot org
2006-06-29 19:27 ` pinskia at gcc dot gnu dot org
2006-08-07 11:59 ` hubicka at gcc dot gnu dot org
2006-08-10  7:36 ` pinskia at gcc dot gnu dot org
2006-08-27 22:33 ` [Bug middle-end/27657] " pinskia at gcc dot gnu dot org
2006-08-28 19:43 ` janis at gcc dot gnu dot org
2006-08-28 20:36 ` pinskia at gcc dot gnu dot org
2006-08-28 20:44 ` geoffk at gcc dot gnu dot org
2006-08-28 22:58 ` janis at gcc dot gnu dot org
2006-10-20  7:42 ` pinskia at gcc dot gnu dot org
2006-12-11 20:23 ` [Bug middle-end/27657] [4.2/4.3 " reichelt at gcc dot gnu dot org
2006-12-26 17:37 ` pinskia at gcc dot gnu dot org
2007-01-29 15:44 ` rguenth at gcc dot gnu dot org
2007-01-29 15:50 ` rguenth at gcc dot gnu dot org
2007-01-30 10:23 ` rguenth at gcc dot gnu dot org
2007-01-30 10:24 ` [Bug middle-end/27657] [4.2 " rguenth at gcc dot gnu dot org
2007-01-31 12:29 ` rguenth at gcc dot gnu dot org
2007-02-01 19:25 ` ismail at pardus dot org dot tr
2007-02-01 19:33 ` tbm at cyrius dot com
2007-02-01 19:51 ` ismail at pardus dot org dot tr
2007-02-04 15:28 ` rguenth at gcc dot gnu dot org
2007-02-04 15:30 ` rguenth at gcc dot gnu dot org
2007-02-04 17:52 ` tbm at cyrius dot com

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).