This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/50029] New: nowrap_type_p encounters void TREE_TYPE
- From: "nash11228 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 9 Aug 2011 15:35:10 +0000
- Subject: [Bug tree-optimization/50029] New: nowrap_type_p encounters void TREE_TYPE
- Auto-submitted: auto-generated
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,