[PATCH v4] diagnostics: Follow DECL_ORIGIN in lhd_print_error_function [PR102061]

2024-08-10 Thread Peter Damianov
so the internal compiler details aren't exposed. gcc/ChangeLog: PR diagnostics/102061 * langhooks.cc (lhd_print_error_function): Follow DECL_ORIGIN links. * gcc.dg/pr102061.c: New testcase. Signed-off-by: Peter Damianov --- v4: Address formatting nits, add comme

[PATCH v3] diagnostics: Follow DECL_ORIGIN in lhd_print_error_function [PR102061]

2024-08-07 Thread Peter Damianov
so the internal compiler details aren't exposed. gcc/ChangeLog: PR diagnostics/102061 * langhooks.cc (lhd_print_error_function): Follow DECL_ORIGIN links. * gcc.dg/pr102061.c: New testcase. Signed-off-by: Peter Damianov --- v3: also follow DECL_ORIGIN when emitt

[PATCH v2] diagnostics: Follow DECL_ORIGIN in lhd_print_error_function [PR102061]

2024-08-07 Thread Peter Damianov
Log: PR diagnostics/102061 * langhooks.cc (lhd_print_error_function): Follow DECL_ORIGIN link Signed-off-by: Peter Damianov --- I struggled to write a testcase for this, as none of the real world cases I tried reduced to anything nice. Hopefully it's okay to skip it

[PATCH v2] diagnostics: Follow DECL_ORIGIN in lhd_decl_printable_name [PR102061]

2024-07-03 Thread Peter Damianov
gcc/ChangeLog: PR diagnostics/102061 * langhooks.cc (lhd_decl_printable_name): Follow DECL_ORIGIN link Signed-off-by: Peter Damianov --- v2: use DECL_ORIGIN instead of DECL_ABSTRACT_ORIGIN and remove loop gcc/langhooks.cc | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH] diagnostics: Follow DECL_ABSTRACT_ORIGIN links in lhd_decl_printable_name [PR102061]

2024-07-02 Thread Peter Damianov
function. gcc/ChangeLog: PR diagnostics/102061 * langhooks.cc (lhd_decl_printable_name): Follow DECL_ABSTRACT_ORIGIN links to the source Signed-off-by: Peter Damianov --- I would add a testcase but I'm not familiar with that process, and would need some help. I also

[PATCH v3 3/3] pretty-print: Don't translate escape sequences to windows console API

2024-06-03 Thread Peter Damianov
s if the console has ENABLE_VIRTUAL_TERMINAL_PROCESSING. Signed-off-by: Peter Damianov --- v3: fix minor comment formatting nit. gcc/pretty-print.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index eb59bf424b7..505230

[PATCH v3 2/3] diagnostics: Don't hardcode auto_enable_urls to false for mingw hosts

2024-06-03 Thread Peter Damianov
return false on mingw hosts. * diagnostic-color.cc (auto_enable_urls): Return true if console supports ansi escape sequences. Signed-off-by: Peter Damianov --- v3: Fix minor comment formatting nit. gcc/diagnostic-color.cc | 19 +++ 1 file changed, 15 inser

[PATCH v3 1/3] diagnostics: Enable escape sequence processing on windows consoles

2024-06-03 Thread Peter Damianov
Signed-off-by: Peter Damianov --- Pinging these patches. The wine ordeal is a problem, but disabling the diagnostics colors with the environment variable should be resolving that. I don't want to intentionally make testing harder, but until wine fixes: https://bugs.winehq.org/show_bug.cgi?id=

[PATCH] libcpp: Correct typo 'r' -> '\r'

2024-05-25 Thread Peter Damianov
libcpp/ChangeLog: * lex.cc (do_peek_prev): Correct typo in argument to __builtin_expect() Signed-off-by: Peter Damianov --- libcpp/lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpp/lex.cc b/libcpp/lex.cc index c9e44e6..de752bdc9c8 100644 --- a/libcpp

[PATCH] .gitattributes: disable crlf translation

2024-05-22 Thread Peter Damianov
lem in the first place. This behavior is never helpful or desired for gcc. Signed-off-by: Peter Damianov --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index e75bfc595bf..1e116987c98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8

[PATCH v3] driver: Output to a temp file; rename upon success [PR80182]

2024-05-12 Thread Peter Damianov
or executable output (driver::maybe_run_linker): Rename output_file_temp to output_file if the linker ran successfully Signed-off-by: Peter Damianov --- v3: don't attempt to create temp files -> rename for -o /dev/null gcc/gcc.cc | 53 +

[PATCH v2] driver: Output to a temp file; rename upon success [PR80182]

2024-05-11 Thread Peter Damianov
or executable output (driver::maybe_run_linker): Rename output_file_temp to output_file if the linker ran successfully Signed-off-by: Peter Damianov --- v2: Make sure temp file is removed in the case of a compiler error gcc/gcc.cc | 51 +++

[PATCH] driver: Output to a temp file; rename upon success [PR80182]

2024-05-11 Thread Peter Damianov
or executable output (driver::maybe_run_linker): Rename output_file_temp to output_file if the linker ran successfully Signed-off-by: Peter Damianov --- gcc/gcc.cc | 50 +- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/gcc

[PATCH v2 3/3] pretty-print: Don't translate escape sequences to windows console API

2024-05-09 Thread Peter Damianov
s if the console has ENABLE_VIRTUAL_TERMINAL_PROCESSING. Signed-off-by: Peter Damianov --- gcc/pretty-print.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index eb59bf424b7..98b6410d6e4 100644 --- a/gcc/pretty-print.cc +++

[PATCH v2 2/3] diagnostics: Don't hardcode auto_enable_urls to false for mingw hosts

2024-05-09 Thread Peter Damianov
return false on mingw hosts. * diagnostic-color.cc (auto_enable_urls): Return true if console supports ansi escape sequences. Signed-off-by: Peter Damianov --- v2: auto_enable_urls should check if the console supports ansi escape sequences gcc/diagnostic-color.cc | 19 +

[PATCH v2 1/3] diagnostics: Enable escape sequence processing on windows consoles

2024-05-09 Thread Peter Damianov
Signed-off-by: Peter Damianov --- Forgot to add -v2 to git send-email the first time I sent. Sorry for the spam. gcc/diagnostic-color.cc | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc index f01a0fc2e37

[PATCH 3/3] pretty-print: Don't translate escape sequences to windows console API

2024-05-09 Thread Peter Damianov
s if the console has ENABLE_VIRTUAL_TERMINAL_PROCESSING. Signed-off-by: Peter Damianov --- gcc/pretty-print.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index eb59bf424b7..98b6410d6e4 100644 --- a/gcc/pretty-print.cc +++

[PATCH 2/3] diagnostics: Don't hardcode auto_enable_urls to false for mingw hosts

2024-05-09 Thread Peter Damianov
return false on mingw hosts. * diagnostic-color.cc (auto_enable_urls): Return true if console supports ansi escape sequences. Signed-off-by: Peter Damianov --- gcc/diagnostic-color.cc | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a

[PATCH 1/3] diagnostics: Enable escape sequence processing on windows consoles

2024-05-09 Thread Peter Damianov
Signed-off-by: Peter Damianov --- gcc/diagnostic-color.cc | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc index f01a0fc2e37..3af198654af 100644 --- a/gcc/diagnostic-color.cc +++ b/gcc/diagnostic-color.cc

[PATCH 3/3] pretty-print: Don't translate escape sequences to windows console API

2024-05-09 Thread Peter Damianov
s if the console has ENABLE_VIRTUAL_TERMINAL_PROCESSING. Signed-off-by: Peter Damianov --- gcc/pretty-print.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index eb59bf424b7..98b6410d6e4 100644 --- a/gcc/pretty-print.cc +++

[PATCH 1/3] diagnostics: Enable escape sequence processing on windows consoles

2024-05-09 Thread Peter Damianov
Signed-off-by: Peter Damianov --- gcc/diagnostic-color.cc | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc index f01a0fc2e37..0a4845406f5 100644 --- a/gcc/diagnostic-color.cc +++ b/gcc/diagnostic-color.cc

[PATCH 2/3] diagnostics: Don't hardcode auto_enable_urls to false for mingw platforms

2024-05-09 Thread Peter Damianov
or.cc (auto_enable_urls): Don't hardcode to return false on mingw hosts. Signed-off-by: Peter Damianov --- gcc/diagnostic-color.cc | 4 1 file changed, 4 deletions(-) diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc index 0a4845406f5..e9183bb293d 100644 --- a/gcc/

[PATCH v2] Driver: Reject output filenames with source file suffixes [PR80182]

2024-05-04 Thread Peter Damianov
pe to bool. (have_O): Change type to bool. (have_E): Change type to bool. (have_S): New global variable. (driver_handle_option): Assign have_S Signed-off-by: Peter Damianov --- v2: use strrchr instead of lrealpath and strchr gcc/gcc.cc | 28 +-

[PATCH] Driver: Reject output filenames with the same suffixes as source files [PR80182]

2024-05-04 Thread Peter Damianov
pe to bool. (have_O): Change type to bool. (have_E): Change type to bool. (have_S): New global variable. (driver_handle_option): Assign have_S Signed-off-by: Peter Damianov --- gcc/gcc.cc | 29 ++--- 1 file changed, 26 insertions(+), 3 deletion

[PATCH v2] Silence two instances of -Wcalloc-transposed-args

2024-05-03 Thread Peter Damianov
libgcc/ * libgcov-util.c (tag_counters): Swap order of arguments to xcalloc. (topen_to_memory_representation): Likewise. Signed-off-by: Peter Damianov --- libgcc/libgcov-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgcc/libgcov-util.c b

[PATCH] Silence two instances of -Wcalloc-transposed-args

2024-04-28 Thread Peter Damianov
Signed-off-by: Peter Damianov --- Fixes these warnings: ../../gcc/gcc/../libgcc/libgcov-util.c: In function 'void tag_counters(unsigned int, int)': ../../gcc/gcc/../libgcc/libgcov-util.c:214:59: warning: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof

[PATCH v3 2/2] lto-wrapper: Truncate files using -truncate driver option [PR110710]

2024-04-28 Thread Peter Damianov
blem only manifested when calling gcc from cmd.exe, and having no sh.exe present on the PATH. The Windows port of GNU Make searches the PATH for an sh.exe, and uses it if present. I have tested this in environments with and without sh.exe on the PATH and confirmed it works as expected. Signed-off-by: Pet

[PATCH v3 1/2] Driver: Add new -truncate option

2024-04-28 Thread Peter Damianov
'-truncate' The motivation for adding this is PR110710. It is used by lto-wrapper to truncate files in a shell-independent manner. Signed-off-by: Peter Damianov --- gcc/common.opt | 6 ++ gcc/gcc.cc | 14 ++ 2 files changed, 20 insertions(+) diff --git a/gcc/common

[PATCH v2 2/2] lto-wrapper: Truncate files using -truncate driver option [PR110710]

2024-04-17 Thread Peter Damianov
blem only manifested when calling gcc from cmd.exe, and having no sh.exe present on the PATH. The Windows port of GNU Make searches the PATH for an sh.exe, and uses it if present. I have tested this in environments with and without sh.exe on the PATH and confirmed it works as expected. Signed-off-by: Pet

[PATCH v2 1/2] Driver: Add new -truncate option

2024-04-17 Thread Peter Damianov
'-truncate' The motivation for adding this is PR110710. It is used by lto-wrapper to truncate files in a shell-independent manner. Signed-off-by: Peter Damianov --- v2: moved truncation to driver::final_actions v2: moved handling of OPT_truncate to be in alphabetic order gcc/common.opt | 6 +

[PATCH 2/2] lto-wrapper: Truncate files using -truncate driver option [PR110710]

2024-04-17 Thread Peter Damianov
blem only manifested when calling gcc from cmd.exe, and having no sh.exe present on the PATH. The Windows port of GNU Make searches the PATH for an sh.exe, and uses it if present. I have tested this in environments with and without sh.exe on the PATH and confirmed it works as expected. Signed-off-by: Pet

[PATCH 1/2] Driver: Add new -truncate option

2024-04-17 Thread Peter Damianov
'-truncate' The motivation for adding this is PR110710. It is used by lto-wrapper to truncate files in a shell-independent manner. Signed-off-by: Peter Damianov --- gcc/common.opt | 5 + gcc/gcc.cc | 13 + 2 files changed, 18 insertions(+) diff --git a/gcc/common

[PATCH] lto: Don't assume a posix shell is usable on windows [PR110710]

2024-03-26 Thread Peter Damianov
this both in environments both with and without sh present, and observed no issues. Signed-off-by: Peter Damianov --- gcc/lto-wrapper.cc | 35 --- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index 5186d04