Hi!
On Wed, Jan 18, 2017 at 12:49:19PM +0100, Dominik Vogt wrote:
> > I think the testcase as written just assumes ICF happens but in a certain
> > way and what broke is that the same functions are ICFed in a different order
> > now, because with -fno-ipa-icf it reports:
> > tattr-2.c: In function ‘p0’:
> > tattr-2.c:23:3: error: Builtin ‘__builtin_tend’ is not supported without 
> > -mhtm (default with -march=zEC12 and higher).
> >    __builtin_tend ();
> >    ^~~~~~~~~~~~~~~~~
> > tattr-2.c: In function ‘a0’:
> > tattr-2.c:42:3: error: Builtin ‘__builtin_tend’ is not supported without 
> > -mhtm (default with -march=zEC12 and higher).
> >    __builtin_tend (); /* { dg-error "is not supported without -mhtm" } */
> >    ^~~~~~~~~~~~~~~~~
> > tattr-2.c: In function ‘htmd’:
> > tattr-2.c:50:3: error: Builtin ‘__builtin_tend’ is not supported without 
> > -mhtm (default with -march=zEC12 and higher).
> >    __builtin_tend (); /* { dg-error "is not supported without -mhtm" } */
> >    ^~~~~~~~~~~~~~~~~
> > So my preference is to add -fno-ipa-icf to dg-options and
> > add the missing dg-error line on line 42.
> 
> You mean line 23.  Does -fno-ipa-icf also enable the error there?
> 
> > Like below, ok for trunk?
> 
> Looks good.

Committed to trunk.
Two more things:
1)
823               error ("Builtin %qF is not supported without -mhtm "
824                      "(default with -march=zEC12 and higher).", fndecl);
   is a bug, diagnostics (I think Fortran FE is a big exception here) should
   not start with capital letters, so it should be "builtin instead of
   "Builtin .  Please look at other diagnostics in config/s390
2) what happens on the testcase is actually quite nasty, which is why
   you get 3 errors instead of just 2 I was expecting with the default
   -fipa-icf - first ICF optimizes a0 + p0 and a1 + p1 calls, with
   current trunk a0 and a1 are thunks that call p0 or p1.  And then
   comes inlining and inlines p0 into a0 and p1 into a1, which basically
   undoes the ICF optimization, but not even that, it is worse than before
   because the debug info as well as locations are as if p0 has been an
   inline function inlined into a0.  Dunno if ICF shouldn't check if
   the functions aren't small enough not to be worth ICFing them together,
   or if inlining shouldn't recognize ICF created thunks and not inline
   into them

        Jakub

Reply via email to