All of lore.kernel.org
 help / color / mirror / Atom feed
* GCC 4.3 and PLABEL32 issues.
@ 2008-03-26  2:59 Carlos O'Donell
  2008-03-26  3:20 ` John David Anglin
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos O'Donell @ 2008-03-26  2:59 UTC (permalink / raw)
  To: John David Anglin, linux-parisc, Aurelien Jarno

Dave,

The following reduced testcase:

cat >> foo.c <<EOF
#include <stdio.h>
#include <stdlib.h>

int main (void) {
  printf ("&printf = %x\n", (unsigned long)&printf);
  if (((unsigned long) &printf) & 3)
    {
      printf ("printf is a PLABEL32\n");
    }
  return 0;
}
EOF

carlos@firin:~/fsrc/gcc-work$
/usr/local/tools/bin/hppa-linux-gcc-4.2.4 -o foo foo.c
carlos@firin:~/fsrc/gcc-work$ ./foo
&printf = 119ea
printf is a PLABEL32

carlos@firin:~/fsrc/gcc-work$
/usr/local/tools/bin/hppa-linux-gcc-4.3.1 -o foo foo.c
carlos@firin:~/fsrc/gcc-work$ ./foo
&printf = 119ea

GCC 4.3, even at -O0, reduces "((unsigned long) &printf) & 3)" to "0".

~~~ foo.c.003t.original ~~~
;; Function main (main)
;; enabled by -tree-original

{
  printf ((const char * restrict) (char *) "&printf = %x\n", (long
unsigned int) printf);
  if (0)
    {
      printf ((const char * restrict) (char *) "printf is a PLABEL32\n");
    }
  return 0;
}
~~~
If the if condition is reduced to "0" as early as 003t.original, does
that mean it's the C frontend fault?

This issue is breaks glibc's detection of PLABEL's during startup
relocation processing.

Cheers,
Carlos.

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

end of thread, other threads:[~2008-03-26 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-26  2:59 GCC 4.3 and PLABEL32 issues Carlos O'Donell
2008-03-26  3:20 ` John David Anglin
2008-03-26 12:00   ` Carlos O'Donell
2008-03-26 12:37   ` Matthew Wilcox
2008-03-26 18:14     ` John David Anglin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.