Re: [PATCHv2] replace atoi with strtoul in opts.cc, lto-wrapper.c, lto/lto.c [PR114542]

2024-12-15 Thread Heiko Eißfeldt
Straight forward replacements of atoi() with strtoul() in order to avoid UB and detect invalid argument values. Tested with x86_64-pc-linux-gnu. 2024-12-16 Heiko Eißfeldt     PR lto/114542     * lto-wrapper.cc (run_gcc):     Use strtoul with ERANGE check instead of atoi     * lto/lto.cc

[PATCH] install.texi --enable-languages: add rust to the list of languages

2024-12-14 Thread Heiko Eißfeldt
While comparing ```grep ^language= */config-lang.in``` with the list from the doc I noticed that the last addition rust was missing. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 9109c172039..1904a0e3c12 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2051,7

Re: [PATCH] replace atoi with strtoul in opts.cc, lto-wrapper.c, lto/lto.c [PR114542]

2024-12-13 Thread Heiko Eißfeldt
I think, I overlooked something, so please ignore that. I will prepare Patch V2 soon. On 12/9/24 8:13 PM, Heiko Eißfeldt wrote: Straight forward replacements of atoi() with strtoul() in order to avoid UB and detect invalid argument values. Tested with x86_64-pc-linux-gnu. 2024-12-09 Heiko

[PATCH] replace atoi with strtoul in opts.cc, lto-wrapper.c, lto/lto.c [PR114542]

2024-12-09 Thread Heiko Eißfeldt
Straight forward replacements of atoi() with strtoul() in order to avoid UB and detect invalid argument values. Tested with x86_64-pc-linux-gnu. 2024-12-09 Heiko Eißfeldt     PR lto/114542     * lto-wrapper.cc (run_gcc):     Use strtoul with ERANGE check instead of atoi     * lto/lto.cc

Re: [PATCH] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-09 Thread Heiko Eißfeldt
; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Heiko Eißfeldt --- gcc/c/gimple-parser.cc | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc index 78e85d93487..1a677fc26c7 100644 --- a/gcc/c/gimple

Re: [PATCH] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-09 Thread Heiko Eißfeldt
this patch. Signed-off-by: Heiko Eißfeldt diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc index 78e85d93487..b018bb6afb6 100644 --- a/gcc/c/gimple-parser.cc +++ b/gcc/c/gimple-parser.cc @@ -133,11 +133,21 @@ c_parser_gimple_parse_bb_spec (tree val, int *index) { if (!startswith (IDENTIFI

Re: [PATCH] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-06 Thread Heiko Eißfeldt
and here is the forgotten patch (it is late...) diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc index 78e85d93487..b018bb6afb6 100644 --- a/gcc/c/gimple-parser.cc +++ b/gcc/c/gimple-parser.cc @@ -133,11 +133,21 @@ c_parser_gimple_parse_bb_spec (tree val, int *index) { if (!startsw

Re: [PATCHv2] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-06 Thread Heiko Eißfeldt
ic block indices after goto in both branches otherwise return with c_parser_error * gcc.dg/pr114541Andrew.c: New test based on Andrew's template in the PR. Signed-off-by: Heiko Eißfeldt On 12/5/24 8:45 AM, Richard Biener wrote: On Thu, Dec 5, 2024 at 1:55 AM Heiko Ei

Re: [PATCH] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-05 Thread Heiko Eißfeldt
On 12/5/24 8:45 AM, Richard Biener wrote: c_parser_gimple_compound_statement returns whether the compound statement ended with a return statement, not whether there was an error, so this change looks wrong. Thanks, I will have to dig deeper to understand error handling then. Heiko

[PATCH] Invalid gimple __BB# accepted due to usage of atoi -> replace atoi with stroul in c_parser_gimple_parse_bb_spec [PR114541]

2024-12-04 Thread Heiko Eißfeldt
errors more generically. In the case of cdil != cdil_gimple now consider them as errors and return early. This avoids further processing with erroneous data. 2024-12-05 Heiko Eißfeldt PR c/114541 * gimple-parser.cc (c_parser_gimple_parse_bb_spec): Use strtoul with ERANGE check

Re: Re [PATCH v5] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-28 Thread Heiko Eißfeldt
ac9fc91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2024-11-28 Heiko Eißfeldt + + * MAINTAINERS: Add myself to write after approval. + 2024-11-25 Sandra Loosemore * MAINTAINERS: Remove references to nios2. diff --git a/MAINTAINERS b/MAINTAINERS index 26455d1cabf..0fab

Re: Re [PATCH v4] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-26 Thread Heiko Eißfeldt
Thanks for your patience! On 11/26/24 8:36 AM, Jakub Jelinek wrote: This is wrongly formatted and valid only in C++17 and later, while GCC is currently written in C++14. So it needs to be static_assert (FIRST_PSEUDO_REGISTER <= INT_MAX, ""); done. Heikodiff --git a/gcc/varasm.cc

Re [PATCH v3] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-25 Thread Heiko Eißfeldt
Thanks for your feedback! On 11/23/24 11:02 PM, Jakub Jelinek wrote: On Sat, Nov 23, 2024 at 07:26:55PM +0100, Heiko Eißfeldt wrote: --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -993,9 +993,12 @@ decode_reg_name_and_count (const char *asmspec, int *pnregs) break; if (asmspec[0

[PATCH v2] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-23 Thread Heiko Eißfeldt
: On 11/22/24 7:40 AM, Heiko Eißfeldt wrote: A simple replacement of atoi() with strtol() in varasm.cc:decode_reg_name_and_count(). Parsing now has errno ERANGE checking, eg no undetected overflow. Being new it is difficult for me to come up with a good test case. So I don't see any tech

[PATCH] replace atoi with strtol in varasm.cc (decode_reg_name_and_count) [PR114540]

2024-11-22 Thread Heiko Eißfeldt
A simple replacement of atoi() with strtol() in varasm.cc:decode_reg_name_and_count(). Parsing now has errno ERANGE checking, eg no undetected overflow. Being new it is difficult for me to come up with a good test case. --- diff --git a/gcc/varasm.cc b/gcc/varasm.cc index acc4b4a0419..d3c60eaf4