public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Ada bootstrap broken on x86 and x86_64
@ 2004-09-06 22:43 Richard Kenner
  2004-09-07  8:12 ` Jan Hubicka
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2004-09-06 22:43 UTC (permalink / raw)
  To: hubicka; +Cc: gcc

    Well, the code is not mine, I just promised to fix bugs while Zdenek
    is away.  However I am just testing the attached patch.  Does it
    appear sane?

Well, the function's description isn't clear enough for me to say for sure,
but it looks close except that I think the function was expected to return
NULL_TREE if addr == obj.

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

* Re: Ada bootstrap broken on x86 and x86_64
  2004-09-06 22:43 Ada bootstrap broken on x86 and x86_64 Richard Kenner
@ 2004-09-07  8:12 ` Jan Hubicka
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Hubicka @ 2004-09-07  8:12 UTC (permalink / raw)
  To: Richard Kenner; +Cc: hubicka, gcc

>     Well, the code is not mine, I just promised to fix bugs while Zdenek
>     is away.  However I am just testing the attached patch.  Does it
>     appear sane?
> 
> Well, the function's description isn't clear enough for me to say for sure,
> but it looks close except that I think the function was expected to return
> NULL_TREE if addr == obj.

I think the other catch is that the function is expected to remove one
wrapper at a time.  I think I will leave this problem to Zdenek unless
it will appear to hit us somehow for now.
Thanks for the explanation
Honza

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

* Re: Ada bootstrap broken on x86 and x86_64
@ 2004-09-07 11:11 Richard Kenner
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Kenner @ 2004-09-07 11:11 UTC (permalink / raw)
  To: jh; +Cc: gcc

    I think the other catch is that the function is expected to remove one
    wrapper at a time.

That seems like a bad idea since it's incompatible with what everything else
in the compiler does and it's also not clear things could notice, but I agree
that the documentation of this function is less than clear.

    I think I will leave this problem to Zdenek unless it will appear to
    hit us somehow for now.  

Makes sense.

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

* Re: Ada bootstrap broken on x86 and x86_64
  2004-09-06 22:01 Richard Kenner
@ 2004-09-06 22:14 ` Jan Hubicka
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Hubicka @ 2004-09-06 22:14 UTC (permalink / raw)
  To: Richard Kenner; +Cc: hubicka, gcc

>     this should fix the problem.  I think that the actual value of ADDR_EXPR
>     (VIEW_CONVERT_EXPR (something)) is equivalent to ADDR_EXPR (something)
>     so I can just ignore it when computing the offsets.
> 
> Yes, but a lot of code code in peel_address looks quite wrong to me.  You
> should never use TREE_INT_CST_LOW without checking that there's no high part
> set: that's what the function tree_low_cst is all about.  I added that
> function back in March of 2000: nobody should be using TREE_CST_CST_LOW in
> this way.
> 
> Moreover, the offset for a COMPONENT_REF must include DECL_FIELD_OFFSET and
> for an ARRAY_REF, you have to take into account the lower bound.  he new
> functions in stor-layout.c (array_ref_low_bound, etc) should be used for this.
> 
> But why not simply use get_inner_reference so that everybody finds offsets
> the same way?  The bug with VIEW_CONVERT_EXPR couldn't have occurred if that
> were used.

Well, the code is not mine, I just promised to fix bugs while Zdenek is
away.  However I am just testing the attached patch.  Does it appear
sane?

thanks,
Honza

Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c	6 Sep 2004 18:38:27 -0000	2.3
--- tree-ssa-loop-ivopts.c	6 Sep 2004 22:13:06 -0000
*************** force_var_cost (struct ivopts_data *data
*** 2513,2566 ****
  static tree
  peel_address (tree addr, unsigned HOST_WIDE_INT *diff)
  {
!   tree off, size;
!   HOST_WIDE_INT bit_offset;
! 
!   switch (TREE_CODE (addr))
!     {
!     case SSA_NAME:
!     case INDIRECT_REF:
!     case BIT_FIELD_REF:
!     case VAR_DECL:
!     case PARM_DECL:
!     case RESULT_DECL:
!     case STRING_CST:
!     case REALPART_EXPR:
!     case IMAGPART_EXPR:
!       return NULL_TREE;
! 
!     case COMPONENT_REF:
!       off = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (addr, 1));
!       bit_offset = TREE_INT_CST_LOW (off);
! 
!       if (bit_offset % BITS_PER_UNIT)
! 	abort ();
!       
!       if (diff)
! 	*diff += bit_offset / BITS_PER_UNIT;
! 
!       return TREE_OPERAND (addr, 0);
! 
!     case ARRAY_REF:
!       off = TREE_OPERAND (addr, 1);
! 
!       if (diff)
! 	{
! 	  if (!cst_and_fits_in_hwi (off))
! 	    return NULL_TREE;
! 
! 	  size = TYPE_SIZE_UNIT (TREE_TYPE (addr));
! 	  if (!cst_and_fits_in_hwi (size))
! 	    return NULL_TREE;
! 
! 	  *diff += TREE_INT_CST_LOW (off) * TREE_INT_CST_LOW (size);
! 	}
! 
!       return TREE_OPERAND (addr, 0);
! 
!     default:
!       abort ();
!     }
  }
  
  /* Checks whether E1 and E2 have constant difference, and if they do,
--- 2513,2532 ----
  static tree
  peel_address (tree addr, unsigned HOST_WIDE_INT *diff)
  {
!   HOST_WIDE_INT bitsize;
!   HOST_WIDE_INT bitpos;
!   tree offset;
!   enum machine_mode mode;
!   int unsignedp;
!   int volatilep;
!   tree obj;
! 
!   obj = get_inner_reference (addr, &bitsize, &bitpos, &offset, &mode, &unsignedp, &volatilep);
!   if (bitpos % BITS_PER_UNIT || offset)
!     return NULL_TREE;
!   if (*diff)
!     *diff += bitpos / BITS_PER_UNIT;
!   return obj;
  }
  
  /* Checks whether E1 and E2 have constant difference, and if they do,

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

* Re: Ada bootstrap broken on x86 and x86_64
@ 2004-09-06 22:01 Richard Kenner
  2004-09-06 22:14 ` Jan Hubicka
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Kenner @ 2004-09-06 22:01 UTC (permalink / raw)
  To: hubicka; +Cc: gcc

    this should fix the problem.  I think that the actual value of ADDR_EXPR
    (VIEW_CONVERT_EXPR (something)) is equivalent to ADDR_EXPR (something)
    so I can just ignore it when computing the offsets.

Yes, but a lot of code code in peel_address looks quite wrong to me.  You
should never use TREE_INT_CST_LOW without checking that there's no high part
set: that's what the function tree_low_cst is all about.  I added that
function back in March of 2000: nobody should be using TREE_CST_CST_LOW in
this way.

Moreover, the offset for a COMPONENT_REF must include DECL_FIELD_OFFSET and
for an ARRAY_REF, you have to take into account the lower bound.  he new
functions in stor-layout.c (array_ref_low_bound, etc) should be used for this.

But why not simply use get_inner_reference so that everybody finds offsets
the same way?  The bug with VIEW_CONVERT_EXPR couldn't have occurred if that
were used.

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

* Re: Ada bootstrap broken on x86 and x86_64
  2004-09-06 20:52 Laurent GUERBY
  2004-09-06 20:55 ` Jan Hubicka
  2004-09-06 21:12 ` Jan Hubicka
@ 2004-09-06 21:28 ` Jan Hubicka
  2 siblings, 0 replies; 10+ messages in thread
From: Jan Hubicka @ 2004-09-06 21:28 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc

> Different failures, my last successful builds where on thursday.
> 
> Laurent
> 
> LAST_UPDATED Mon Sep  6 20:02:44 UTC 2004
> 
> On x86 in stage2:
> 
> <<
> stage1/xgcc -Bstage1/ -B/home/guerby/work/gcc/install/install-20040906T220450/i686-pc-linux-gnu/bin/ -c -g -O2      -gnatpg -gnata -g -O1 -fno-inline \
>  -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada /home/guerby/work/gcc/version-head/gcc/ada/a-except.adb -o ada/a-except.o
> +===========================GNAT BUG DETECTED==============================+
> | 3.5.0 20040906 (experimental) (i686-pc-linux-gnu) GCC error:             |
> | in peel_address, at tree-ssa-loop-ivopts.c:2562                          |
> | Error detected at a-exexda.adb:312:8                                     |
> >>

Hi,
this should fix the problem.  I think that the actual value of ADDR_EXPR
(VIEW_CONVERT_EXPR (something)) is equivalent to ADDR_EXPR (something)
so I can just ignore it when computing the offsets.

Honza

Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c	6 Sep 2004 18:38:27 -0000	2.3
--- tree-ssa-loop-ivopts.c	6 Sep 2004 21:25:56 -0000
*************** peel_address (tree addr, unsigned HOST_W
*** 2541,2546 ****
--- 2541,2549 ----
  
        return TREE_OPERAND (addr, 0);
  
+     case VIEW_CONVERT_EXPR:
+       return TREE_OPERAND (addr, 0);
+ 
      case ARRAY_REF:
        off = TREE_OPERAND (addr, 1);
  

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

* Re: Ada bootstrap broken on x86 and x86_64
  2004-09-06 20:52 Laurent GUERBY
  2004-09-06 20:55 ` Jan Hubicka
@ 2004-09-06 21:12 ` Jan Hubicka
  2004-09-06 21:28 ` Jan Hubicka
  2 siblings, 0 replies; 10+ messages in thread
From: Jan Hubicka @ 2004-09-06 21:12 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc

> Different failures, my last successful builds where on thursday.
> 
> Laurent
> 
> LAST_UPDATED Mon Sep  6 20:02:44 UTC 2004
> 
> On x86 in stage2:
> 
> <<
> stage1/xgcc -Bstage1/ -B/home/guerby/work/gcc/install/install-20040906T220450/i686-pc-linux-gnu/bin/ -c -g -O2      -gnatpg -gnata -g -O1 -fno-inline \
>  -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada /home/guerby/work/gcc/version-head/gcc/ada/a-except.adb -o ada/a-except.o
> +===========================GNAT BUG DETECTED==============================+
> | 3.5.0 20040906 (experimental) (i686-pc-linux-gnu) GCC error:             |
> | in peel_address, at tree-ssa-loop-ivopts.c:2562                          |
> | Error detected at a-exexda.adb:312:8                                     |
> >>

Actually I don't think I can build Ada myself with current tree so I
need help.

This bug should be trivial to fix: Ada is apparently using construct
tree-ssa-loop-ivopts.c, so I just need to know output of
p debug_tree (addr) on the function calling abort and I will add it to
the list.

Honza
> 
> On x86_64 when building the Ada RTS:
> 
> <<
> ../../xgcc -B../../ -c -g -O2 -fPIC      -W -Wall -gnatpg  a-calend.adb -o a-calend.o
> a-calend.adb: In function `Ada.Calendar.Split':
> a-calend.adb:262: error: Definition in block 12 does not dominate use in block 3
> for SSA_NAME: T.184<D887>_103
> in statement:
> T.192<D895>_113 = T.184<D887>_103 /[fl] 1767225600000000000;
> 
> +===========================GNAT BUG DETECTED==============================+
> | 3.5.0 20040906 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
> | verify_ssa failed.                                                       |
> | Error detected at a-calend.adb:487:1                                     |
> >>

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

* Re: Ada bootstrap broken on x86 and x86_64
  2004-09-06 20:52 Laurent GUERBY
@ 2004-09-06 20:55 ` Jan Hubicka
  2004-09-06 21:12 ` Jan Hubicka
  2004-09-06 21:28 ` Jan Hubicka
  2 siblings, 0 replies; 10+ messages in thread
From: Jan Hubicka @ 2004-09-06 20:55 UTC (permalink / raw)
  To: Laurent GUERBY; +Cc: gcc

> Different failures, my last successful builds where on thursday.
> 
> Laurent
> 
> LAST_UPDATED Mon Sep  6 20:02:44 UTC 2004
> 
> On x86 in stage2:
> 
> <<
> stage1/xgcc -Bstage1/ -B/home/guerby/work/gcc/install/install-20040906T220450/i686-pc-linux-gnu/bin/ -c -g -O2      -gnatpg -gnata -g -O1 -fno-inline \
>  -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada /home/guerby/work/gcc/version-head/gcc/ada/a-except.adb -o ada/a-except.o
> +===========================GNAT BUG DETECTED==============================+
> | 3.5.0 20040906 (experimental) (i686-pc-linux-gnu) GCC error:             |
> | in peel_address, at tree-ssa-loop-ivopts.c:2562                          |
> | Error detected at a-exexda.adb:312:8                                     |
> >>
> 
> On x86_64 when building the Ada RTS:
> 
> <<
> ../../xgcc -B../../ -c -g -O2 -fPIC      -W -Wall -gnatpg  a-calend.adb -o a-calend.o
> a-calend.adb: In function `Ada.Calendar.Split':
> a-calend.adb:262: error: Definition in block 12 does not dominate use in block 3
> for SSA_NAME: T.184<D887>_103
> in statement:
> T.192<D895>_113 = T.184<D887>_103 /[fl] 1767225600000000000;

This should by fixed by my last patch.  Would be possible to try once
again?  (it should not be neccesary to rebuild - just update and
loop-ivopts fixed)

Honza
> 
> +===========================GNAT BUG DETECTED==============================+
> | 3.5.0 20040906 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
> | verify_ssa failed.                                                       |
> | Error detected at a-calend.adb:487:1                                     |
> >>

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

* Re:  Ada bootstrap broken on x86 and x86_64
@ 2004-09-06 20:54 Richard Kenner
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Kenner @ 2004-09-06 20:54 UTC (permalink / raw)
  To: laurent; +Cc: gcc

I have a different set of failures, which broke at roughly the same time.

I sent email about them on Friday and will repeat it tomorrow, when people
should be getting back from the long weekend.

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

* Ada bootstrap broken on x86 and x86_64
@ 2004-09-06 20:52 Laurent GUERBY
  2004-09-06 20:55 ` Jan Hubicka
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Laurent GUERBY @ 2004-09-06 20:52 UTC (permalink / raw)
  To: gcc

Different failures, my last successful builds where on thursday.

Laurent

LAST_UPDATED Mon Sep  6 20:02:44 UTC 2004

On x86 in stage2:

<<
stage1/xgcc -Bstage1/ -B/home/guerby/work/gcc/install/install-20040906T220450/i686-pc-linux-gnu/bin/ -c -g -O2      -gnatpg -gnata -g -O1 -fno-inline \
 -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada /home/guerby/work/gcc/version-head/gcc/ada/a-except.adb -o ada/a-except.o
+===========================GNAT BUG DETECTED==============================+
| 3.5.0 20040906 (experimental) (i686-pc-linux-gnu) GCC error:             |
| in peel_address, at tree-ssa-loop-ivopts.c:2562                          |
| Error detected at a-exexda.adb:312:8                                     |
>>

On x86_64 when building the Ada RTS:

<<
../../xgcc -B../../ -c -g -O2 -fPIC      -W -Wall -gnatpg  a-calend.adb -o a-calend.o
a-calend.adb: In function `Ada.Calendar.Split':
a-calend.adb:262: error: Definition in block 12 does not dominate use in block 3
for SSA_NAME: T.184<D887>_103
in statement:
T.192<D895>_113 = T.184<D887>_103 /[fl] 1767225600000000000;

+===========================GNAT BUG DETECTED==============================+
| 3.5.0 20040906 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| verify_ssa failed.                                                       |
| Error detected at a-calend.adb:487:1                                     |
>>

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

end of thread, other threads:[~2004-09-07 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-06 22:43 Ada bootstrap broken on x86 and x86_64 Richard Kenner
2004-09-07  8:12 ` Jan Hubicka
  -- strict thread matches above, loose matches on Subject: below --
2004-09-07 11:11 Richard Kenner
2004-09-06 22:01 Richard Kenner
2004-09-06 22:14 ` Jan Hubicka
2004-09-06 20:54 Richard Kenner
2004-09-06 20:52 Laurent GUERBY
2004-09-06 20:55 ` Jan Hubicka
2004-09-06 21:12 ` Jan Hubicka
2004-09-06 21:28 ` Jan Hubicka

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