public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070
@ 2022-11-16 19:36 anlauf at gcc dot gnu.org
  2022-11-16 19:37 ` [Bug bootstrap/107722] Bootstrap " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-16 19:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107722
           Summary: Boostrap failure for some locales starting with
                    r13-4070
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

I get the following failure on OpenSuse 15.3 with g++-11 and with r13-4070
(system is x86_64-pc-linux-gnu):

make[2]: Verzeichnis „/work/gnu/git/build-trunk/gcc“ wird betreten
/work/gnu/git/build-trunk/./gcc/xgcc -B/work/gnu/git/build-trunk/./gcc/  -xc
-nostdinc /dev/null -S -o /dev/null
-fself-test=../../gcc-trunk/gcc/testsuite/selftests
../../gcc-trunk/gcc/diagnostic.cc:2584: assert_location_text: FAIL:
ASSERT_STREQ (expected_loc_text, actual_loc_text)
 val1="<built-in>:"
 val2="<built-in>:42:10:"

PROGNAME: interner Compiler-Fehler: in fail_formatted, bei selftest.cc:63
0x1f1747e selftest::fail_formatted(selftest::location const&, char const*, ...)
        ../../gcc-trunk/gcc/selftest.cc:63
0x1f17521 selftest::assert_streq(selftest::location const&, char const*, char
const*, char const*, char const*)
        ../../gcc-trunk/gcc/selftest.cc:92
0x1f1cf96 assert_location_text
        ../../gcc-trunk/gcc/diagnostic.cc:2584
0x1f1f30e test_diagnostic_get_location_text
        ../../gcc-trunk/gcc/diagnostic.cc:2596
0x1f1f30e selftest::c_diagnostic_cc_tests()
        ../../gcc-trunk/gcc/diagnostic.cc:2681
0x99cbe7 selftest::c_family_tests()
        ../../gcc-trunk/gcc/c-family/c-common.cc:9144
0x1e40963 selftest::run_tests()
        ../../gcc-trunk/gcc/selftest-run-tests.cc:119
0xf27f69 toplev::run_self_tests()
        ../../gcc-trunk/gcc/toplev.cc:2184
Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;
inclusive vorverarbeitetem Quellcode (siehe -freport-bug).
Bitte fügen Sie jedem Fehlerbericht die vollständige Aufrufkette bei.
Weitere Hinweise finden Sie unter »<https://gcc.gnu.org/bugs/>«.
make[2]: *** [../../gcc-trunk/gcc/c/Make-lang.in:128: s-selftest-c] Fehler 1
make[2]: Verzeichnis „/work/gnu/git/build-trunk/gcc“ wird verlassen
make[1]: *** [Makefile:4573: all-gcc] Fehler 2
make[1]: Verzeichnis „/work/gnu/git/build-trunk“ wird verlassen
make: *** [Makefile:1024: all] Fehler 2

However, if I change the locale using LC_ALL=C, the compile succeeds.

Am I missing something?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
@ 2022-11-16 19:37 ` pinskia at gcc dot gnu.org
  2022-11-16 19:45 ` [Bug bootstrap/107722] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-16 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
  2022-11-16 19:37 ` [Bug bootstrap/107722] Bootstrap " pinskia at gcc dot gnu.org
@ 2022-11-16 19:45 ` pinskia at gcc dot gnu.org
  2022-11-16 20:09 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-16 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-11-16

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
static void
test_diagnostic_get_location_text ()
{
  const char *old_progname = progname;
  progname = "PROGNAME";
  assert_location_text ("PROGNAME:", NULL, 0, 0, true);
  assert_location_text ("<built-in>:", "<built-in>", 42, 10, true);


Hmmm. This is where 42 and 10 are coming from.
Oh the problem is the use directly "<built-in>" here rather than
special_fname_builtin .

This might fix/improve that:
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 22f7b0b6d6e..5764ce672ec 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -470,7 +470,7 @@ diagnostic_get_location_text (diagnostic_context *context,
   const char *file = s.file ? s.file : progname;
   int line = 0;
   int col = -1;
-  if (strcmp (file, N_("<built-in>")))
+  if (strcmp (file, special_fname_builtin ()))
     {
       line = s.line;
       if (context->show_column)
@@ -2593,7 +2593,7 @@ test_diagnostic_get_location_text ()
   const char *old_progname = progname;
   progname = "PROGNAME";
   assert_location_text ("PROGNAME:", NULL, 0, 0, true);
-  assert_location_text ("<built-in>:", "<built-in>", 42, 10, true);
+  assert_location_text ("<built-in>:", special_fname_builtin(), 42, 10, true);
   assert_location_text ("foo.c:42:10:", "foo.c", 42, 10, true);
   assert_location_text ("foo.c:42:9:", "foo.c", 42, 10, true, 0);
   assert_location_text ("foo.c:42:1010:", "foo.c", 42, 10, true, 1001);


But I am not 100% sure it is correct ....

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
  2022-11-16 19:37 ` [Bug bootstrap/107722] Bootstrap " pinskia at gcc dot gnu.org
  2022-11-16 19:45 ` [Bug bootstrap/107722] [13 Regression] " pinskia at gcc dot gnu.org
@ 2022-11-16 20:09 ` anlauf at gcc dot gnu.org
  2022-11-22 11:40 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-16 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #1)
> This might fix/improve that:
> diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
> index 22f7b0b6d6e..5764ce672ec 100644
> --- a/gcc/diagnostic.cc
> +++ b/gcc/diagnostic.cc
> @@ -470,7 +470,7 @@ diagnostic_get_location_text (diagnostic_context
> *context,
>    const char *file = s.file ? s.file : progname;
>    int line = 0;
>    int col = -1;
> -  if (strcmp (file, N_("<built-in>")))
> +  if (strcmp (file, special_fname_builtin ()))
>      {
>        line = s.line;
>        if (context->show_column)
> @@ -2593,7 +2593,7 @@ test_diagnostic_get_location_text ()
>    const char *old_progname = progname;
>    progname = "PROGNAME";
>    assert_location_text ("PROGNAME:", NULL, 0, 0, true);
> -  assert_location_text ("<built-in>:", "<built-in>", 42, 10, true);
> +  assert_location_text ("<built-in>:", special_fname_builtin(), 42, 10,
> true);
>    assert_location_text ("foo.c:42:10:", "foo.c", 42, 10, true);
>    assert_location_text ("foo.c:42:9:", "foo.c", 42, 10, true, 0);
>    assert_location_text ("foo.c:42:1010:", "foo.c", 42, 10, true, 1001);
> 
> 
> But I am not 100% sure it is correct ....

Sorry, the first hunk fails, as special_fname_builtin () is already there.
The second part applies, but then I get:

/work/gnu/git/build-trunk/./gcc/xgcc -B/work/gnu/git/build-trunk/./gcc/  -xc
-nostdinc /dev/null -S -o /dev/null
-fself-test=../../gcc-trunk/gcc/testsuite/selftests
../../gcc-trunk/gcc/diagnostic.cc:2584: assert_location_text: FAIL:
ASSERT_STREQ (expected_loc_text, actual_loc_text)
 val1="<built-in>:"
 val2="<eingebaut>:"

PROGNAME: interner Compiler-Fehler: in fail_formatted, bei selftest.cc:63
0x1f1ccee selftest::fail_formatted(selftest::location const&, char const*, ...)
        ../../gcc-trunk/gcc/selftest.cc:63
0x1f1cd91 selftest::assert_streq(selftest::location const&, char const*, char
const*, char const*, char const*)
        ../../gcc-trunk/gcc/selftest.cc:92
0x1f22806 assert_location_text
        ../../gcc-trunk/gcc/diagnostic.cc:2584
0x1f24b81 test_diagnostic_get_location_text
        ../../gcc-trunk/gcc/diagnostic.cc:2596
0x1f24b81 selftest::c_diagnostic_cc_tests()
        ../../gcc-trunk/gcc/diagnostic.cc:2681
0x99ea97 selftest::c_family_tests()
        ../../gcc-trunk/gcc/c-family/c-common.cc:9146
0x1e46873 selftest::run_tests()
        ../../gcc-trunk/gcc/selftest-run-tests.cc:119
0xf29e69 toplev::run_self_tests()
        ../../gcc-trunk/gcc/toplev.cc:2184
Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;
inclusive vorverarbeitetem Quellcode (siehe -freport-bug).
Bitte fügen Sie jedem Fehlerbericht die vollständige Aufrufkette bei.
Weitere Hinweise finden Sie unter »<https://gcc.gnu.org/bugs/>«.
make[2]: *** [../../gcc-trunk/gcc/c/Make-lang.in:128: s-selftest-c] Fehler 1
make[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....
make[2]: Verzeichnis „/work/gnu/git/build-trunk/gcc“ wird verlassen
make[1]: *** [Makefile:4573: all-gcc] Fehler 2
make[1]: Verzeichnis „/work/gnu/git/build-trunk“ wird verlassen
make: *** [Makefile:1024: all] Fehler 2

So the localization is only partly dealt with.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-11-16 20:09 ` anlauf at gcc dot gnu.org
@ 2022-11-22 11:40 ` jakub at gcc dot gnu.org
  2022-11-22 18:55 ` anlauf at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-22 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jakub at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 53942
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53942&action=edit
gcc13-pr107722.patch

So like this?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-11-22 11:40 ` jakub at gcc dot gnu.org
@ 2022-11-22 18:55 ` anlauf at gcc dot gnu.org
  2022-11-23 13:40 ` lhyatt at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-11-22 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 53942 [details]
> gcc13-pr107722.patch
> 
> So like this?

Yes, this patch makes the compile succeed with my locale.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-11-22 18:55 ` anlauf at gcc dot gnu.org
@ 2022-11-23 13:40 ` lhyatt at gcc dot gnu.org
  2022-11-23 13:44 ` cvs-commit at gcc dot gnu.org
  2022-11-23 13:49 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: lhyatt at gcc dot gnu.org @ 2022-11-23 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lhyatt at gcc dot gnu.org

--- Comment #5 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
Thanks for the fix, and sorry for missing this case.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-11-23 13:40 ` lhyatt at gcc dot gnu.org
@ 2022-11-23 13:44 ` cvs-commit at gcc dot gnu.org
  2022-11-23 13:49 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-23 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:d601708870ad8dc3ef935e440bf03394891d42e2

commit r13-4265-gd601708870ad8dc3ef935e440bf03394891d42e2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Nov 23 14:43:48 2022 +0100

    diagnostics: Fix selftest ICE in certain locales [PR107722]

    As reported in the PR, since special_fname_builtin () call has been
    introduced, the diagnostics code compares filename against _("<built-in>")
    rather than "<built-in>", which means that if self tests are performed
    with the string being translated, one self-test fails.
    The following patch fixes that.

    2022-11-23  Jakub Jelinek  <jakub@redhat.com>

            PR bootstrap/107722
            * diagnostic.cc (test_diagnostic_get_location_text): Test
            special_fname_builtin () rather than "<built-in>" and expect
            special_fname_builtin () concatenated with ":" for it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/107722] [13 Regression] Bootstrap failure for some locales starting with r13-4070
  2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-11-23 13:44 ` cvs-commit at gcc dot gnu.org
@ 2022-11-23 13:49 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-23 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-23 13:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 19:36 [Bug bootstrap/107722] New: Boostrap failure for some locales starting with r13-4070 anlauf at gcc dot gnu.org
2022-11-16 19:37 ` [Bug bootstrap/107722] Bootstrap " pinskia at gcc dot gnu.org
2022-11-16 19:45 ` [Bug bootstrap/107722] [13 Regression] " pinskia at gcc dot gnu.org
2022-11-16 20:09 ` anlauf at gcc dot gnu.org
2022-11-22 11:40 ` jakub at gcc dot gnu.org
2022-11-22 18:55 ` anlauf at gcc dot gnu.org
2022-11-23 13:40 ` lhyatt at gcc dot gnu.org
2022-11-23 13:44 ` cvs-commit at gcc dot gnu.org
2022-11-23 13:49 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).