[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 --- Comment #10 from Jim Wilson --- Author: wilson Date: Tue Apr 17 21:41:07 2018 New Revision: 259449 URL: https://gcc.gnu.org/viewcvs?rev=259449=gcc=rev Log: RISC-V: Fix 32-bit stack pointer alignment problem. gcc/ PR 84856 * config/riscv/riscv.c (riscv_compute_frame_info): Add calls to RISCV_STACK_ALIGN when using outgoing_args_size and pretend_args_size. Set arg_pointer_offset after using pretend_args_size. Modified: trunk/gcc/ChangeLog trunk/gcc/config/riscv/riscv.c
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 --- Comment #9 from Kito Cheng --- Hi Jim: Yeah, you are right, so I guess just some missing in back-end now, thanks your quick response :)
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 --- Comment #8 from Jim Wilson --- I copied the design of the patch from the i386 backend, so in theory it should work. The layout of the stack is completely at the control of the target backend, so uses of STACK_BOUNDARY outside the backend should not be a problem. I did some sanity checking when I made the check, but now that you point the problem out I see that I missed two cases. outgoing_args_size and pretend_args_size are not longer rounded to the PREFERRED_STACK_BOUNDARY size, they are rounded to the smaller STACK_BOUNDARY size instead. We can fix this in riscv_compute_frame_info by adding RISCV_STACK_ALIGN macro calls around the uses of these two values. This is a simple fix. I'm testing a patch now.
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 Kito Cheng changed: What|Removed |Added CC||npickito at gmail dot com --- Comment #7 from Kito Cheng --- Hi Jim: Your fixed changed the stack alignment at all, MIN_STACK_BOUNDARY is only used in backed, but STACK_BOUNDARY will reference in may place to align the stack. riscv32-elf-gcc gcc/testsuite/gcc.c-torture/execute/20010518-1.c -o - -S ... .globl main .type main, @function main: addisp,sp,-40 <-- sw ra,36(sp) sw s0,32(sp) ...
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 Jim Wilson changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Assignee|unassigned at gcc dot gnu.org |wilson at gcc dot gnu.org --- Comment #6 from Jim Wilson --- Patch committed.
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 --- Comment #5 from Jim Wilson --- Author: wilson Date: Mon Mar 19 18:08:24 2018 New Revision: 258650 URL: https://gcc.gnu.org/viewcvs?rev=258650=gcc=rev Log: RISC-V: Fix bootstrap failure. gcc/ PR bootstrap/84856 * config/riscv/riscv.c (riscv_function_arg_boundary): Use PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY. (riscv_first_stack_step): Likewise. (riscv_option_override): Use STACK_BOUNDARY instead of MIN_STACK_BOUNDARY. * config/riscv/riscv.h (STACK_BOUNDARY): Renamed from MIN_STACK_BOUNDARY. (BIGGEST_ALIGNMENT): Set to 128. (PREFERRED_STACK_BOUNDARY): Renamed from STACK_BOUNDARY. (RISCV_STACK_ALIGN): Use PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY. Modified: trunk/gcc/ChangeLog trunk/gcc/config/riscv/riscv.c trunk/gcc/config/riscv/riscv.h
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 Serge Belyshev changed: What|Removed |Added CC||wilson at gcc dot gnu.org --- Comment #4 from Serge Belyshev --- CC: Jim Wilson, as it is a recent change by him. https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01989.html
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 --- Comment #3 from Jakub Jelinek --- Perhaps making it unsigned short would be better, though I wonder if it just isn't a bug that STACK_BOUNDARY is not constant, that is ABI changing thing, doesn't __attribute__((aligned)) change based on what BIGGEST_ALIGNMENT is?
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- Have you tried to make the variables signed instead (or HOST_WIDE_INT)?
[Bug bootstrap/84856] Bootstrap failure on riscv: comparison of integer expressions of different signedness
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84856 David Abdurachmanov changed: What|Removed |Added CC||david.abdurachmanov at gmail dot c ||om --- Comment #1 from David Abdurachmanov --- I am using bdba439399552531c0fe82da5037386715f07940 (git) or r258481 (svn) and I hit the same issue: ../../gcc/calls.c: In function ‘poly_int64 compute_argument_block_size(int, args_size*, tree, tree, int)’: ../../gcc/calls.c:2201:60: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] if (ACCUMULATE_OUTGOING_ARGS && preferred_stack_boundary > STACK_BOUNDARY)