This is the mail archive of the gcc-patches@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]

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)


>   if (TREE_CODE (arg) == ADDR_EXPR)
>     {
>+      tree argtype = TREE_TYPE (arg);
>+      chartype = argtype;

This assignment should be unnecessary here.  Right?

>+
>       arg = TREE_OPERAND (arg, 0);
>       tree ref = arg;
>       if (TREE_CODE (arg) == ARRAY_REF)
> 	{
> 	  tree idx = TREE_OPERAND (arg, 1);
>-	  if (TREE_CODE (idx) != INTEGER_CST)
>+	  if (TREE_CODE (idx) != INTEGER_CST
>+	      && TREE_CODE (argtype) == POINTER_TYPE)

What else could the type of an ADDR_EXPR be?
argtype is TREE_TYPE(arg).
Do you have a test case where TREE_CODE(argtype) is not POINTER_TYPE?


Bernd.

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