This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix miscompilation in output_constant_def


Maxim Kuvyrkov wrote:

>> However, I'm not sure whether that copying needs to happen in
>> output_constant_def, or could happen somewhere later in the process.
>> What does the call stack look like at the point where the RTX "escapes"
>> from varasm.c?
> 
> The backtrace is rather unamusing:
> 
> #0  output_constant_def (exp=0xf7dd7e70, defer=1) at varasm.c:3259
> #1  0x0830c8ea in expand_expr_constant (exp=0xf7dd7e70, defer=1,
> modifier=EXPAND_NORMAL) at expr.c:6799

> But you're right, copying should be done sometime later and that place
> is, I believe, unshare rtl pass. 

> Therefore, if we set this flag in output_constant_def, the RTX will be
> copied, if still used, in unshare pass.  Still, this is basically the
> same as copying the rtx in output_constant_def itself.

I like this idea.  That should make copies if and only if actually
necessary, which seems like a good thing.  If nobody objects within 72
hours, please go ahead and check this in.  If you can put together a
test case to go with the patch, that would be a good thing.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]