https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102955
Bug ID: 102955
Summary: assembler errors when bootstrapping with #pragma
optimize "0"
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
This is to make a record of a problem I recently ran into with GCC 12 and that
apparently others have as well. As discussed here:
https://gcc.gnu.org/pipermail/gcc/2021-October/237616.html
Putting #pragma GCC optimize "0" at the top of gimplify.c to debug something in
a bootstrapped compiler causes the file to fail to assemble with a stage 2 GCC
due to many assembler errors like this:
/tmp/ccL9zcXD.s: Assembler messages:
/tmp/ccL9zcXD.s:9: Error: CFI instruction used without previous
.cfi_startproc
The top of gimplify.s is below (this is with no other code changes to any files
except the #pragma).
.file "gimplify.c"
.text
.local _ZZ20gimplify_va_arg_exprPP9tree_nodePP6gimpleS4_E9gave_help
.comm
_ZZ20gimplify_va_arg_exprPP9tree_nodePP6gimpleS4_E9gave_help,1,1
.p2align 4
.type _ZL19handled_component_pPK9tree_node, @function
_ZL19handled_component_pPK9tree_node:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movzwl (%rax), %eax
movzwl %ax, %eax
subl $47, %eax
cmpl $6, %eax
ja .L2
movl $1, %eax
jmp .L3
.L2:
movl $0, %eax
.L3:
popq %rbp
.cfi_def_cfa 7, 8
ret