Re: PR middle-end/52141: ICE due to asm statement

2012-02-20 Thread Richard Henderson
On 02/20/12 13:16, Aldy Hernandez wrote: > PR middle-end/52141 > * trans-mem.c (ipa_tm_scan_irr_block): Error out on GIMPLE_ASM's > in a transaction safe function. Ok. r~

Re: PR middle-end/52141: ICE due to asm statement

2012-02-20 Thread Aldy Hernandez
On 02/20/12 03:56, Richard Guenther wrote: On Thu, Feb 16, 2012 at 7:26 PM, Aldy Hernandez wrote: On 02/16/12 12:04, Jakub Jelinek wrote: On Thu, Feb 16, 2012 at 11:46:33AM -0600, Aldy Hernandez wrote: #GOOD houston:/build/t2/gcc$ ./cc1 a.c -fgnu-tm -O0 -quiet -w In function 'asmfunc',

Re: PR middle-end/52141: ICE due to asm statement

2012-02-20 Thread Jakub Jelinek
On Mon, Feb 20, 2012 at 10:56:30AM +0100, Richard Guenther wrote: > Disabling early inlining for TM is a hack, I don't think you want to make > people pay the optimizing penalty just because of asm diagnostics. Yeah, it is unfortunate that without -g the diagnostic will be less verbose, but even f

Re: PR middle-end/52141: ICE due to asm statement

2012-02-20 Thread Richard Guenther
On Thu, Feb 16, 2012 at 7:26 PM, Aldy Hernandez wrote: > On 02/16/12 12:04, Jakub Jelinek wrote: >> >> On Thu, Feb 16, 2012 at 11:46:33AM -0600, Aldy Hernandez wrote: >>> >>> #GOOD >>> houston:/build/t2/gcc$ ./cc1 a.c -fgnu-tm -O0 -quiet -w >>> In function 'asmfunc', >>>     inlined from 'f' at a.

Re: PR middle-end/52141: ICE due to asm statement

2012-02-16 Thread Jakub Jelinek
On Thu, Feb 16, 2012 at 11:46:33AM -0600, Aldy Hernandez wrote: > #GOOD > houston:/build/t2/gcc$ ./cc1 a.c -fgnu-tm -O0 -quiet -w > In function 'asmfunc', > inlined from 'f' at a.c:13:10: > a.c:7:3: error: asm not allowed in 'transaction_safe' function > > #BAD > houston:/build/t2/gcc$ ./cc1 a

Re: PR middle-end/52141: ICE due to asm statement

2012-02-16 Thread Aldy Hernandez
On 02/16/12 12:04, Jakub Jelinek wrote: On Thu, Feb 16, 2012 at 11:46:33AM -0600, Aldy Hernandez wrote: #GOOD houston:/build/t2/gcc$ ./cc1 a.c -fgnu-tm -O0 -quiet -w In function 'asmfunc', inlined from 'f' at a.c:13:10: a.c:7:3: error: asm not allowed in 'transaction_safe' function #BAD ho

Re: PR middle-end/52141: ICE due to asm statement

2012-02-16 Thread Aldy Hernandez
On 02/15/12 12:07, Jakub Jelinek wrote: On Wed, Feb 15, 2012 at 11:59:15AM -0600, Aldy Hernandez wrote: Hmmm, isn't %K for trees? We're talking gimple, and FUNCTION_DECLs, which don't have a TREE_BLOCK, here. Gimple stmts have gimple_block, I guess you'd need to create some tree and set its T

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Jakub Jelinek
On Wed, Feb 15, 2012 at 11:59:15AM -0600, Aldy Hernandez wrote: > Hmmm, isn't %K for trees? We're talking gimple, and FUNCTION_DECLs, > which don't have a TREE_BLOCK, here. Gimple stmts have gimple_block, I guess you'd need to create some tree and set its TREE_BLOCK and EXPR_LOCATION from gimple_

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Aldy Hernandez
On 02/15/12 11:32, Jakub Jelinek wrote: On Wed, Feb 15, 2012 at 09:29:18AM -0800, Richard Henderson wrote: On 02/15/2012 01:48 AM, Richard Guenther wrote: Hmm. I think you rather want to teach local_pure_const about TM properties you want to know and have them propagated properly (of course un

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Jakub Jelinek
On Wed, Feb 15, 2012 at 09:29:18AM -0800, Richard Henderson wrote: > On 02/15/2012 01:48 AM, Richard Guenther wrote: > > Hmm. I think you rather want to teach local_pure_const about TM > > properties you want to know and have them propagated properly > > (of course unless pure/const which is about

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Richard Henderson
On 02/15/2012 01:48 AM, Richard Guenther wrote: > Hmm. I think you rather want to teach local_pure_const about TM > properties you want to know and have them propagated properly > (of course unless pure/const which is about optimization and has an > easy fallback default yours wouldn't have that -

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Aldy Hernandez
[rth, please correct me if I have misrepresented the TM semantics and rules]. On 02/15/12 09:04, Richard Guenther wrote: Ok, I had a look at the bugreport and am curios why __attribute__((always_inline)) static void asmfunc(void) { __asm__ (""); } __attribute__((transaction_safe)) static

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Richard Guenther
On Wed, Feb 15, 2012 at 3:30 PM, Aldy Hernandez wrote: > On 02/15/12 03:48, Richard Guenther wrote: >> >> On Tue, Feb 14, 2012 at 6:47 PM, Richard Henderson  wrote: >>> >>> On 02/14/2012 08:46 AM, Aldy Hernandez wrote: The call to ipa_tm_diagnose_tm_safe() does nothing because there are

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Aldy Hernandez
On 02/15/12 03:48, Richard Guenther wrote: On Tue, Feb 14, 2012 at 6:47 PM, Richard Henderson wrote: On 02/14/2012 08:46 AM, Aldy Hernandez wrote: The call to ipa_tm_diagnose_tm_safe() does nothing because there are no longer any calls in the function, since the function call has been inlined

Re: PR middle-end/52141: ICE due to asm statement

2012-02-15 Thread Richard Guenther
On Tue, Feb 14, 2012 at 6:47 PM, Richard Henderson wrote: > On 02/14/2012 08:46 AM, Aldy Hernandez wrote: >> The call to ipa_tm_diagnose_tm_safe() does nothing because there are no >> longer any calls in the function, since the function call has been inlined: >> >> f () >> { >> : >>   __asm__ __v

Re: PR middle-end/52141: ICE due to asm statement

2012-02-14 Thread Richard Henderson
On 02/14/2012 08:46 AM, Aldy Hernandez wrote: > The call to ipa_tm_diagnose_tm_safe() does nothing because there are no > longer any calls in the function, since the function call has been inlined: > > f () > { > : > __asm__ __volatile__(""); > return; > > } > > Perhaps we could issue the e

PR middle-end/52141: ICE due to asm statement

2012-02-14 Thread Aldy Hernandez
I swear, these inline asms in transactions are going to be the death of me. In the attached testcase diagnose_tm_blocks() and lower_tm() do not recognize the GIMPLE_ASM because early inlining has not yet run, so there is nothing to see. However, by the time we run the IPA TM pass, the assembl