[Bug middle-end/105009] New: [12 Regression] Fails to build with --target=xtensa-esp32-elf

bero at lindev dot ch gcc-bugzilla@gcc.gnu.org
Tue Mar 22 02:12:58 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105009

            Bug ID: 105009
           Summary: [12 Regression] Fails to build with
                    --target=xtensa-esp32-elf
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bero at lindev dot ch
  Target Milestone: ---

Trying to build gcc 12 (snapshot 20220313) with --target=xtensa-esp32-elf fails
because tree_to_poly_int64, tree_to_poly_uint64, tree_to_shwi and tree_to_uhwi
are implemented in both gcc/tree.h and gcc/tree.cc:

../../gcc/tree.cc:3222:1: error: redefinition of a 'extern inline' function
'tree_to_poly_int64' is not supported in C++
tree_to_poly_int64 (const_tree t)
^
../../gcc/tree.h:4691:1: note: previous definition is here
tree_to_poly_int64 (const_tree t)
^
../../gcc/tree.cc:3231:1: error: redefinition of a 'extern inline' function
'tree_to_poly_uint64' is not supported in C++
tree_to_poly_uint64 (const_tree t)
^
../../gcc/tree.h:4698:1: note: previous definition is here
tree_to_poly_uint64 (const_tree t)
^
../../gcc/tree.cc:6350:1: error: redefinition of a 'extern inline' function
'tree_to_shwi' is not supported in C++
tree_to_shwi (const_tree t)
^
../../gcc/tree.h:4677:1: note: previous definition is here
tree_to_shwi (const_tree t)
^
../../gcc/tree.cc:6361:1: error: redefinition of a 'extern inline' function
'tree_to_uhwi' is not supported in C++
tree_to_uhwi (const_tree t)
^
../../gcc/tree.h:4684:1: note: previous definition is here
tree_to_uhwi (const_tree t)
^


Simply commenting out/removing the extra definitions in gcc/tree.h seems to be
sufficient to fix the problem.


More information about the Gcc-bugs mailing list