[Bug tree-optimization/60533] [4.8/4.9 regression] Error introduced by cunrolli pass at -O3

wschmidt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 16 15:00:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60533

Bill Schmidt <wschmidt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #11 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
(In reply to pinskia@gmail.com from comment #10)

> What is the type of bc?  That access to bc in bb 46 looks like to be the
> cause. 
> 
> What is the original code look like, do we have an out of bounds access here
> or just a miscombining to create one?
> 

Hm, yeah.  This is user error.  We have

  static Direction bc[43][3];

so the complete unrolling 3 times is justified.  The loop iterates over the
last bound and terminates only if a flag value Neighborhood3D::Error is found
in the array.  So if there's bad data in the array such that this is never
present we will run into the barrier.

The input data appears to be loaded from:

template <int DUMMY>
Direction NeighborCode3D::StaticData<DUMMY>::bc[43][3] = {
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, Error},
            { Error, Error, Error},
            { InFront, West, Error},
            { InFront, West, Error},
            { InFront, Error,Error},
            { Error, Error, Error},
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { North, West, Error},
            { North, West, Error},
            { North, Error, Error},
            { Error, Error, Error},
            { West, Error, Error},
            { West, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { North, West, Error},
            { North, West, Error},
            { North, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { Error, Error, Error},
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, Error},
            { Error, Error, Error},
            { InFront, West, Error},
            { InFront, West, Error},
            { InFront, Error, Error},
            { Error, Error, Error},
            { InFront, North, West},
            { InFront, North, West},
            { InFront, North, Error}
        };

Many of the entries don't contain an Error node, leading to the problem.

Thanks, Eric and Andrew, for helping me work through this one.  Closing as
invalid.



More information about the Gcc-bugs mailing list