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: [tree-ssa] tree-ssa fixes


On Wed, 18 Sep 2002, Jeff Law wrote:

> 
> Whee.
> 
> We were goofing the dataflow information for a couple cases.
> 
> For indirect calls, we didn't create any uses for the variable holding
> the target function's address.  Ouch.
> 
Damn.  I knew I was forgetting something when I removed this code
a few days ago.  Remember that you mentioned that it was odd that
we were finding V_USEs for function names?  At the time I thought
"isn't that silly".  So, I removed it.

But the real trick was actually not creating references for
FUNCTION_DECLs (that fix went in earlier today).  Oh, well.
Thanks for adding it back in.


> 	* tree-dfa.c (find_refs_in_stmt): Search for references in the
> 	size expression for a VAR_DECL.
> 	(find_refs_in_stmt): Search for references in the call address
> 	of a CALL_EXPR.
> 	(find_refs_in_stmt): Handle SAVE_EXPRs.
> 
Ouch.  SAVE_EXPRs should be welcomed with a call to abort().  The
simplifier is supposed to remove them.  Also, in trying to see
where we are getting these SAVE_EXPRs, I applied your patch and
got an abort when compiling this program:

main()
{
  int c = 30;
  int a[c];
  a[2] = 10;
}

$ ./cc1 -O2 -fdump-tree-all-ssa a.c
 main
a.c: In function `main':
a.c:4: internal compiler error: in assign_stack_temp_for_type, at function.c:648Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Without the patch, I can compile the file and, indeed, the
simplifier is letting a SAVE_EXPR slip by.  Jason, is this
SAVE_EXPR removable?

$ ./cc1 -O2 -fdump-tree-all-ssa a.c
 main
Execution times (seconds)
 TOTAL                 :   0.01             0.00             0.00

$ cat a.c.t04.simple 
main()
{
  int c;
  unsigned int T.4;
  unsigned int T.3;
  int T.2;
  int T.1;
  c = 30;
  T.1 = c * 4;
  T.2 = T.1 + -4;
  T.3 = (unsigned int)T.2;
  T.4 = T.3 + 4;
  int a[(unsigned int)SAVE_EXPR <T.2> + 4];
  a[2] = 10;
}


Thanks.  Diego.


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