public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22051] New: [4.0 regression] Wrong code for function pointer comparision during optimization
@ 2005-06-13 16:14 tausq at debian dot org
  2005-06-13 16:16 ` [Bug tree-optimization/22051] [4.0 regression/hppa-linux] " tausq at debian dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: tausq at debian dot org @ 2005-06-13 16:14 UTC (permalink / raw)
  To: gcc-bugs

with the following test program, gcc-4.0 doesn't emit the required function
canonicalization code (calls to __canonicalize_funcptr_for_compare) to do the
comparison when optimization is enabled.

tausq@riot:/tmp/dl$ gcc-3.3 -D_GNU_SOURCE -O2 -o default default.c -ldl;
./default; echo $?
0

tausq@riot:/tmp/dl$ gcc-4.0 -D_GNU_SOURCE -O2 -o default default.c -ldl;
./default; echo $?
1


#include <dlfcn.h>
#include <stdio.h>

int
main (int argc, char *argv[])
{
  void *p;

  /* Find function `main'.  */
  p = dlsym (RTLD_DEFAULT, "main");
  if (p == NULL)
    return -1;
  else if ((int (*)(int, char **))p != main)
    return 1;
  else
    return 0;
 }

-- 
           Summary: [4.0 regression] Wrong code for function pointer
                    comparision during optimization
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tausq at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa-unknown-linux
  GCC host triplet: hppa-unknown-linux
GCC target triplet: hppa-unknown-linux


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


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

end of thread, other threads:[~2005-07-01 19:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-13 16:14 [Bug tree-optimization/22051] New: [4.0 regression] Wrong code for function pointer comparision during optimization tausq at debian dot org
2005-06-13 16:16 ` [Bug tree-optimization/22051] [4.0 regression/hppa-linux] " tausq at debian dot org
2005-06-13 16:20 ` [Bug middle-end/22051] [4.0/4.1 regression] " pinskia at gcc dot gnu dot org
2005-06-13 16:24 ` tausq at debian dot org
2005-06-13 16:24 ` randolph at tausq dot org
2005-06-13 16:36 ` danglin at gcc dot gnu dot org
2005-06-14  0:14 ` danglin at gcc dot gnu dot org
2005-06-14  0:17 ` [Bug tree-optimization/22051] " pinskia at gcc dot gnu dot org
2005-06-14  0:18 ` pinskia at gcc dot gnu dot org
2005-06-14  0:53 ` danglin at gcc dot gnu dot org
2005-06-24 13:24 ` mmitchel at gcc dot gnu dot org
2005-06-24 14:24 ` randolph at tausq dot org
2005-06-27  2:54 ` dave at hiauly1 dot hia dot nrc dot ca
2005-07-01 19:04 ` law at redhat 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).