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

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