[Bug tree-optimization/80304] [7 Regression] Wrong result with do concurrent

bernd.edlinger at hotmail dot de gcc-bugzilla@gcc.gnu.org
Thu Apr 6 10:46:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80304

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot de

--- Comment #17 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Thomas Koenig from comment #15)
> Also fails on powerpc64-unknown-linux-gnu.
> 
> r239317 works, r239326 fails, and also appears to be the only
> patch in the vicinity that does anything about loops.
> 
> Could this be the cause?
> 
> Author: edlinger
> Date: Fri Aug 12 19:30:39 2016
> New Revision: 239426
> 
> URL: https://gcc.gnu.org/viewcvs?rev=239426&root=gcc&view=rev
> Log:
> 2016-08-12  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
>         PR tree-optimization/71083
>         * tree-predcom.c (ref_at_iteration): Use a COMPONENT_REF for the
>         bitfield access when possible.
> 
> Modified:
>     trunk/gcc/ChangeLog
>     trunk/gcc/tree-predcom.c

I really doubt that, because that optimization pass is only used at -O3.
What I can see is that at -O1 -fno-inline 
the *.optimized simply does not initialize i:

sub ()
{
  unsigned int ivtmp.38;
  integer(kind=4) j.28;
  real(kind=4) D.3534;
  real(kind=4) D.3527;
  struct __st_parameter_dt dt_parm.4;
  integer(kind=4) j.1;
  integer(kind=4) i.0;
  integer(kind=8) _2;
  integer(kind=8) _3;
  real(kind=4) _7;
  real(kind=4) _8;
  real(kind=4) _13;
  real(kind=4) _15;
  real(kind=4) _24;
  real(kind=4) val.8_25;
  struct FRAME.test * _26;
  sizetype _39;
  real(kind=4) val.5_48;
  real(kind=4) val.8_55;
  real(kind=4) val.5_71;
  real(kind=4) _72;
  sizetype _76;
  real(kind=4) _101;
  real(kind=4) _103;
  real(kind=4) _113;
  real(kind=4) val.8_114;
  real(kind=4) _116;
  real(kind=4) val.8_117;
  real(kind=4) _125;
  real(kind=4) val.5_126;
  real(kind=4) _128;
  real(kind=4) val.5_129;

  <bb 2> [6.83%]:
  CHAIN.19_29(D)->a = {};
  CHAIN.19_29(D)->b = {};
  j.1 = 0;

  <bb 3> [13.67%]:
  # ivtmp.38_68 = PHI <ivtmp.38_1(3), 0(2)>
  j.28_86 = (integer(kind=4)) ivtmp.38_68;
  _2 = (integer(kind=8)) j.28_86;
  _3 = _2 * 2;
  _101 = add (&i.0);

so it is clear why that can not work.
at .gimple it was initialized:


sub ()
{
  logical(kind=1) D.3551;
  logical(kind=1) D.3554;

  a = {};
  b = {};
  {
    integer(kind=4) i.0;
    integer(kind=4) j.1;

    try
      {
        {
          integer(kind=4) count.2;
          integer(kind=4) count.3;

          j.1 = 0;
          count.3 = 2;
          <D.3550>:
          _1 = count.3 <= 0;
          D.3551 = ANNOTATE (_1, 0);
          if (D.3551 != 0) goto L.3; else goto <D.3552>;
          <D.3552>:
          i.0 = 0;
          count.2 = 2;
          <D.3553>:
          _2 = count.2 <= 0;
          D.3554 = ANNOTATE (_2, 0);
          if (D.3554 != 0) goto L.2; else goto <D.3555>;
          <D.3555>:
          j.12_3 = j.1;
          _4 = (integer(kind=8)) j.12_3;
          _5 = _4 * 2;
          i.13_6 = i.0;
          _7 = (integer(kind=8)) i.13_6;
          _8 = _5 + _7;
          _9 = add (&i.0);


More information about the Gcc-bugs mailing list