This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/50029] New: nowrap_type_p encounters void TREE_TYPE


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

           Summary: nowrap_type_p encounters void TREE_TYPE
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nash11228@gmail.com


in function 
bool
scev_probably_wraps_p (tree base, tree step,
               gimple at_stmt, struct loop *loop,
               bool use_overflow_semantics)
{
...

if TREE_CODE (base) == SSA_NAME, the TREE_TYPE (base) is void, which can
introduce segfault.

the following workaround patch shows what problem I have got.


Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c
+++ tree-ssa-loop-niter.c
@@ -3166,7 +3166,7 @@ scev_probably_wraps_p (tree base, tree s

   /* If we can use the fact that signed and pointer arithmetics does not
      wrap, we are done.  */
-  if (use_overflow_semantics && nowrap_type_p (TREE_TYPE (base)))
+  if (use_overflow_semantics && TREE_TYPE (base) && nowrap_type_p (TREE_TYPE
(base)))
     return false;

   /* To be able to use estimates on number of iterations of the loop,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]