[gcc] Replace rsp/rbp lea base with esp/ebp

This is yet another fix for POINTERS_EXTEND_UNSIGNED > 0 problem of keeping high part of rsp/rbp.

In addition, minor fix for previous change - do not assert if writing rsp/rbp into memory (probably spill)?

Test (-O1) must return 0 but returns high part of rsp without the fix:

struct StringRef {
 const char *Data;
 unsigned Length;

// Prevent inlining with 'weak' attribute
int print_size(struct StringRef Data) __attribute__((weak));

int print_size(struct StringRef Data) {
 return Data.Length;

int main() {
 char str[6]; // NEEDED!

 struct StringRef s;
 s.Data = str + 3; // NEEDED!
 s.Length = 0;

 return print_size(s);

TEST=see above

Review URL: http://codereview.chromium.org/6271009
3 files changed
tree: 2edacfe8ccfb5e45be93897ec6780304ed4738dd
  1. binutils/
  2. gcc/
  3. gdb/
  4. newlib/
  5. codereview.settings