diff mbox

[GIMPLE,FE] add fma_expr

Message ID 58AC0F20.4080404@foss.arm.com
State New
Headers show

Commit Message

Kyrill Tkachov Feb. 21, 2017, 9:57 a.m. UTC
On 21/02/17 08:56, Richard Biener wrote:
> On Tue, 21 Feb 2017, Kyrill Tkachov wrote:
>
>> On 21/02/17 08:43, Richard Biener wrote:
>>> On Mon, 20 Feb 2017, Kyrill Tkachov wrote:
>>>
>>>> Hi Prathamesh,
>>>>
>>>> On 16/02/17 12:47, Prathamesh Kulkarni wrote:
>>>>> Hi Richard,
>>>>> The attached patch handles fma_expr in gimple-fe.
>>>>> Does it look OK ?
>>>>>
>>>>> Thanks,
>>>>> Prathamesh
>>>> I see the new test ICEing on aarch64-none-elf.
>>> FMA_EXPR relies on either target support or library support so the
>>> testcase should be appropriately limited to targets supporting that.
>>> { target c99_runtime } maybe.
>> That does skip it on aarch64-none-elf, but is ICEing the expected behaviour in
>> this case?
>> Shouldn't the frontend give an error message of some kind?
> Well, IMHO it's not the purpose of the FE to reject all invalid IL.  We
> have verifiers for this.

Ok, here's the patch to add the target selector.
Newlib doesn't implement fmal for long double I guess (it's the long double fma that fails here).
Is this ok?

Thanks,
Kyrill

2016-02-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.dg/gimplefe-26.c: Require c99_runtime.


>> Or is the gimple frontend considered an internal feature and any errors in
>> input are expected
>> to cause an ICE?
> Yes, mostly.  The FE itself shouldn't ICE.
>
> Richard.
>
>> Thanks,
>> Kyrill
>>
>>> Richard.
>>>
>>>> Thanks,
>>>> Kyrill
>>>>
>>>> ------------------------------------------
>>>>
>>>> $DIR/build-aarch64/obj/gcc2/gcc/xgcc -B$DIR/build-aarch64/obj/gcc2/gcc/
>>>> $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c -fno-diagnos
>>>> tics-show-caret -fdiagnostics-color=never -O -fgimple
>>>> -fdump-tree-ssa-gimple
>>>> -S -specs=aem-ve.specs -o gimplefe-26.s
>>>> $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c: In function 'foo_3':
>>>> $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c:5:18: internal compiler error:
>>>> in
>>>> expand_expr_real_2, at expr.c:8705
>>>> $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c:14:1: note: in expansion of
>>>> macro
>>>> 'foo'
>>>> 0x84e7a3 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
>>>> expand_modifier)
>>>>           $DIR/gcc/gcc/expr.c:8705
>>>> 0x838bd6 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
>>>> expand_modifier, rtx_def**, bool)
>>>>           $DIR/gcc/gcc/expr.c:9730
>>>> 0x83f0f5 expand_expr_real(tree_node*, rtx_def*, machine_mode,
>>>> expand_modifier,
>>>> rtx_def**, bool)
>>>>           $DIR/gcc/gcc/expr.c:8072
>>>> 0x73ab2f expand_expr
>>>>           $DIR/gcc/gcc/expr.h:276
>>>> 0x73ab2f expand_return
>>>>           $DIR/gcc/gcc/cfgexpand.c:3526
>>>> 0x73ab2f expand_gimple_stmt_1
>>>>           $DIR/gcc/gcc/cfgexpand.c:3610
>>>> 0x73ab2f expand_gimple_stmt
>>>>           $DIR/gcc/gcc/cfgexpand.c:3737
>>>> 0x73d55b expand_gimple_basic_block
>>>>           $DIR/gcc/gcc/cfgexpand.c:5744
>>>> 0x740b14 execute
>>>>           $DIR/gcc/gcc/cfgexpand.c:6357
>>>> Please submit a full bug report,
>>>> with preprocessed source if appropriate.
>>>> Please include the complete backtrace with any bug report.
>>>> See <https://gcc.gnu.org/bugs/> for instructions.
>>>>
>>>>
>>

Comments

Richard Biener Feb. 21, 2017, 10:04 a.m. UTC | #1
On Tue, 21 Feb 2017, Kyrill Tkachov wrote:

> 
> On 21/02/17 08:56, Richard Biener wrote:
> > On Tue, 21 Feb 2017, Kyrill Tkachov wrote:
> > 
> > > On 21/02/17 08:43, Richard Biener wrote:
> > > > On Mon, 20 Feb 2017, Kyrill Tkachov wrote:
> > > > 
> > > > > Hi Prathamesh,
> > > > > 
> > > > > On 16/02/17 12:47, Prathamesh Kulkarni wrote:
> > > > > > Hi Richard,
> > > > > > The attached patch handles fma_expr in gimple-fe.
> > > > > > Does it look OK ?
> > > > > > 
> > > > > > Thanks,
> > > > > > Prathamesh
> > > > > I see the new test ICEing on aarch64-none-elf.
> > > > FMA_EXPR relies on either target support or library support so the
> > > > testcase should be appropriately limited to targets supporting that.
> > > > { target c99_runtime } maybe.
> > > That does skip it on aarch64-none-elf, but is ICEing the expected
> > > behaviour in
> > > this case?
> > > Shouldn't the frontend give an error message of some kind?
> > Well, IMHO it's not the purpose of the FE to reject all invalid IL.  We
> > have verifiers for this.
> 
> Ok, here's the patch to add the target selector.
> Newlib doesn't implement fmal for long double I guess (it's the long double
> fma that fails here).
> Is this ok?

Yes.

Thanks,
Richard.

> Thanks,
> Kyrill
> 
> 2016-02-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>     * gcc.dg/gimplefe-26.c: Require c99_runtime.
> 
> 
> > > Or is the gimple frontend considered an internal feature and any errors in
> > > input are expected
> > > to cause an ICE?
> > Yes, mostly.  The FE itself shouldn't ICE.
> > 
> > Richard.
> > 
> > > Thanks,
> > > Kyrill
> > > 
> > > > Richard.
> > > > 
> > > > > Thanks,
> > > > > Kyrill
> > > > > 
> > > > > ------------------------------------------
> > > > > 
> > > > > $DIR/build-aarch64/obj/gcc2/gcc/xgcc
> > > > > -B$DIR/build-aarch64/obj/gcc2/gcc/
> > > > > $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c -fno-diagnos
> > > > > tics-show-caret -fdiagnostics-color=never -O -fgimple
> > > > > -fdump-tree-ssa-gimple
> > > > > -S -specs=aem-ve.specs -o gimplefe-26.s
> > > > > $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c: In function 'foo_3':
> > > > > $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c:5:18: internal compiler
> > > > > error:
> > > > > in
> > > > > expand_expr_real_2, at expr.c:8705
> > > > > $DIR/gcc/gcc/testsuite/gcc.dg/gimplefe-26.c:14:1: note: in expansion
> > > > > of
> > > > > macro
> > > > > 'foo'
> > > > > 0x84e7a3 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
> > > > > expand_modifier)
> > > > >           $DIR/gcc/gcc/expr.c:8705
> > > > > 0x838bd6 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
> > > > > expand_modifier, rtx_def**, bool)
> > > > >           $DIR/gcc/gcc/expr.c:9730
> > > > > 0x83f0f5 expand_expr_real(tree_node*, rtx_def*, machine_mode,
> > > > > expand_modifier,
> > > > > rtx_def**, bool)
> > > > >           $DIR/gcc/gcc/expr.c:8072
> > > > > 0x73ab2f expand_expr
> > > > >           $DIR/gcc/gcc/expr.h:276
> > > > > 0x73ab2f expand_return
> > > > >           $DIR/gcc/gcc/cfgexpand.c:3526
> > > > > 0x73ab2f expand_gimple_stmt_1
> > > > >           $DIR/gcc/gcc/cfgexpand.c:3610
> > > > > 0x73ab2f expand_gimple_stmt
> > > > >           $DIR/gcc/gcc/cfgexpand.c:3737
> > > > > 0x73d55b expand_gimple_basic_block
> > > > >           $DIR/gcc/gcc/cfgexpand.c:5744
> > > > > 0x740b14 execute
> > > > >           $DIR/gcc/gcc/cfgexpand.c:6357
> > > > > Please submit a full bug report,
> > > > > with preprocessed source if appropriate.
> > > > > Please include the complete backtrace with any bug report.
> > > > > See <https://gcc.gnu.org/bugs/> for instructions.
> > > > > 
> > > > > 
> > > 
> 
>
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/gimplefe-26.c b/gcc/testsuite/gcc.dg/gimplefe-26.c
index 55a4624..bc2f3b1 100644
--- a/gcc/testsuite/gcc.dg/gimplefe-26.c
+++ b/gcc/testsuite/gcc.dg/gimplefe-26.c
@@ -1,4 +1,4 @@ 
-/* { dg-do compile } */
+/* { dg-do compile { target c99_runtime } } */
 /* { dg-options "-O -fgimple -fdump-tree-ssa-gimple" } */
 
 #define foo(type, num) \