public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43888]  New: FAIL: gcc.dg/alias-7.c execution test
@ 2010-04-25 18:32 davek at gcc dot gnu dot org
  2010-04-25 18:33 ` [Bug target/43888] " davek at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-04-25 18:32 UTC (permalink / raw)
  To: gcc-bugs

Here's what the alias-7.c test looks like, after preprocessing:

> int foo __asm__ ("_" "foo") __attribute__((nocommon));
> extern __typeof (foo) bar __attribute__ ((weak, alias ("foo")));
> 
> int
> main (void)
> {
>   if (&foo != &bar || foo || bar)
>     abort ();
>   return bar;
> }

  But here's how it compiles down using 4.5.0 on i686-pc-cygwin:

> alias-7.c.003t.original:
> ;; Function main (null)
> ;; enabled by -tree-original
> 
> 
> {
>   if (1)
>     {
>       abort ();
>     }
>   return bar;
> }


  I've established that fold_comparison is returning (integer_cst 1) for the
"&foo != &bar" test.  In this clause,

>       /* For non-equal bases we can simplify if they are addresses
> 	 of local binding decls or constants.  */
>       else if (indirect_base0 && indirect_base1
> 	       /* We know that !operand_equal_p (base0, base1, 0)
> 		  because the if condition was false.  But make
> 		  sure two decls are not the same.  */
> 	       && base0 != base1
> 	       && TREE_CODE (arg0) == ADDR_EXPR
> 	       && TREE_CODE (arg1) == ADDR_EXPR
> 	       && (((TREE_CODE (base0) == VAR_DECL
> 		     || TREE_CODE (base0) == PARM_DECL)
> 		    && (targetm.binds_local_p (base0)
> 			|| CONSTANT_CLASS_P (base1)))
> 		   || CONSTANT_CLASS_P (base0))
> 	       && (((TREE_CODE (base1) == VAR_DECL
> 		     || TREE_CODE (base1) == PARM_DECL)
> 		    && (targetm.binds_local_p (base1)
> 			|| CONSTANT_CLASS_P (base0)))
> 		   || CONSTANT_CLASS_P (base1)))
> 	{
> 	  if (code == EQ_EXPR)
> 	    return omit_two_operands_loc (loc, type, boolean_false_node,
> 				      arg0, arg1);
> 	  else if (code == NE_EXPR)
> 	    return omit_two_operands_loc (loc, type, boolean_true_node,
> 				      arg0, arg1);
> 	}

it seems that i386_pe_binds_local_p is incorrectly returning true even for the
weak symbol.  I have a patch.


-- 
           Summary: FAIL: gcc.dg/alias-7.c execution test
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: davek at gcc dot gnu dot org
        ReportedBy: davek at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


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

* [Bug target/43888] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
@ 2010-04-25 18:33 ` davek at gcc dot gnu dot org
  2010-04-25 18:36 ` davek at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-04-25 18:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

davek at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-25 18:33:07
               date|                            |


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


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

* [Bug target/43888] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
  2010-04-25 18:33 ` [Bug target/43888] " davek at gcc dot gnu dot org
@ 2010-04-25 18:36 ` davek at gcc dot gnu dot org
  2010-04-30 15:30 ` davek at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-04-25 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from davek at gcc dot gnu dot org  2010-04-25 18:36 -------
Created an attachment (id=20487)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20487&action=view)
Simple fix.

Maybe a bit verbose; I only made it a separate if clause so it could have its
own comment, but should probably just integrate it into the preceding if.

This resolves the failing testcase mentioned in the title, and also IIRC fixed
g++.dg/eh/weak1.C.  I'm testing it against the release of 4.5.0 that I'm
currently preparing for the cygwin distro and posting it here so I don't forget
to backport it upstream.


-- 


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


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

* [Bug target/43888] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
  2010-04-25 18:33 ` [Bug target/43888] " davek at gcc dot gnu dot org
  2010-04-25 18:36 ` davek at gcc dot gnu dot org
@ 2010-04-30 15:30 ` davek at gcc dot gnu dot org
  2010-05-02 23:56 ` [Bug target/43888] [4.5/4.6 Regression] " davek at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-04-30 15:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from davek at gcc dot gnu dot org  2010-04-30 15:30 -------
Posted: http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01899.html


-- 

davek at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, wrong-code


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


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

* [Bug target/43888] [4.5/4.6 Regression] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-30 15:30 ` davek at gcc dot gnu dot org
@ 2010-05-02 23:56 ` davek at gcc dot gnu dot org
  2010-05-06 16:06 ` davek at gcc dot gnu dot org
  2010-07-09  0:21 ` davek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-05-02 23:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from davek at gcc dot gnu dot org  2010-05-02 23:56 -------
Applied to trunk at r.158983.


-- 

davek at gcc dot gnu dot org changed:

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


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


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

* [Bug target/43888] [4.5/4.6 Regression] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-05-02 23:56 ` [Bug target/43888] [4.5/4.6 Regression] " davek at gcc dot gnu dot org
@ 2010-05-06 16:06 ` davek at gcc dot gnu dot org
  2010-07-09  0:21 ` davek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-05-06 16:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from davek at gcc dot gnu dot org  2010-05-06 16:06 -------
Subject: Bug 43888

Author: davek
Date: Thu May  6 16:06:18 2010
New Revision: 159111

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159111
Log:
        PR target/43888
        * config/i386/winnt.c (i386_pe_binds_local_p): Tweak weak symbol
        handling to still return true for x64 targets.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/winnt.c


-- 


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


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

* [Bug target/43888] [4.5/4.6 Regression] FAIL: gcc.dg/alias-7.c execution test
  2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-05-06 16:06 ` davek at gcc dot gnu dot org
@ 2010-07-09  0:21 ` davek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-07-09  0:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from davek at gcc dot gnu dot org  2010-07-09 00:21 -------
Subject: Bug 43888

Author: davek
Date: Fri Jul  9 00:20:58 2010
New Revision: 161982

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161982
Log:
2010-07-09  Dave Korn  <dave.korn.cygwin@gmail.com>

        Backport from mainline
        2010-05-06  Dave Korn  <dave.korn.cygwin@gmail.com>

        PR target/43888
        * config/i386/winnt.c (i386_pe_binds_local_p): Tweak weak symbol
        handling to still return true for x64 targets.


Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/i386/winnt.c


-- 


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


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

end of thread, other threads:[~2010-07-09  0:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-25 18:32 [Bug target/43888] New: FAIL: gcc.dg/alias-7.c execution test davek at gcc dot gnu dot org
2010-04-25 18:33 ` [Bug target/43888] " davek at gcc dot gnu dot org
2010-04-25 18:36 ` davek at gcc dot gnu dot org
2010-04-30 15:30 ` davek at gcc dot gnu dot org
2010-05-02 23:56 ` [Bug target/43888] [4.5/4.6 Regression] " davek at gcc dot gnu dot org
2010-05-06 16:06 ` davek at gcc dot gnu dot org
2010-07-09  0:21 ` davek 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).