This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CSE bug when narrowing constants
- From: Gary Funck <gary at intrepid dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Dec 2008 09:28:05 -0800
- Subject: Re: CSE bug when narrowing constants
- References: <20081129000211.GA4373@intrepid.com> <200811291445.50008.ebotcazou@adacore.com> <20081129143616.GB26598@intrepid.com> <200812011150.48738.ebotcazou@adacore.com>
On 12/01/08 11:50:48, Eric Botcazou wrote:
> > cse_insn() calls lookup_as_function() ultimately through fold_rtx(), IIRC,
> > and is the routine that writes the REG_EQUAL note.
>
> OK, thanks. But I'm a little at a loss as to why this problem arises only
> now: the problematic code in lookup_as_function is one decade old. Do you
> happen to have older compilers around (say GCC 4.1.x based) that correctly
> compile the testcase? If so, what happens differently with them?
Yeah, I was surprised as well. The compiler base line
this problem arose on is 4.2.3, but I think that it will
occur in both older and newer base lines. The problem is
triggered by code generated by the UPC (Unified Parllel C)
support that we've implemented in a project we call GCC/UPC.
It fails on a small UPC test case, but a number
of factors have to be present to trigger the problem.
I tried developing a vanilla C test case to duplicate the
problem, but have so far been unsuccessful.
Internally, we use VIEW_CONVERT_EXPR to overlay a TImode
container on top of a struct. There is no exact C
equivalent, though a union comes close. I tried that,
but couldn't replicate the exact set of events that have
to be present to hit the problem. I send what I tried
to you separately. Perhaps adding some
sort of logging in lookup_as_function() that indicates
narrowing is occurring, and then running all test cases
(including Ada, because its unchecked_conversion is close
to what we're doing internally) would turn something up?