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]

[tree-ssa] More CCP fixes [patch]


This patch fixes almost all regressions in c-torture when
-ftree-ssa-ccp is enabled.  There are two regressions that have
not been fixed yet:

1- Constant propagation of bitfield references.  This is a
   simplification problem in execute/bf-sign-1:

      struct  {
	signed int s:3;
	unsigned int u:3;
	int i:3;
      } x = {-1, -1, -1};

      if (x.u != 7)

   The above is simplified  into:

      x = {.s=-1, .u=-1, .i=-1};
      T.1 = (int)x.u;
      if (T.1 != 7)

   I think CCP should use the bitfield size to determine the
   value for T.1.  Or maybe the simplifier should expose the
   bitfield size when simplifying.  I'm still not sure.


2- unsorted/i++.c fails because in:

    i = 2;
    i = i;

   CCP replaces the second assignment with '2 = i'.  As per Dan's
   suggestion, we need to keep pointers to the expressions that
   contain them.
   
   
Bootstrapped on x86.


Diego.

Attachment: 20020811-1353-ccp-fixes.diff
Description: Text document


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