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 target/45980] Use not in stead of add to generate new constant


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

--- Comment #1 from Carrot <carrot at google dot com> 2010-10-18 06:24:04 UTC ---
The replacement of constant loading with add operations is occurred at pass
postreload in function reload_cse_move2add. It is straight forward to extend
that to other ALU operations, such as not, and, or, xor, shift ...

But there is a problem as shown in this example. 

      context->state[0] = 0x67452301;    // r3
      context->state[1] = 0xEFCDAB89;
      context->state[2] = 0x98BADCFE;
      context->state[3] = 0x10325476;

After the first statement, value 0x67452301 is in register r3, and after the
second statement, value 0xEFCDAB89 is in r3, and the original value 0x67452301
is lost, so we can't get the third value by simple "movns r3, r3". We need some
form of register renaming at the same time.


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