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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I can't reproduce this in my i686-linux builds unfortunately.
--- gcc/json-parsing.cc.jj      2024-11-19 10:23:59.183145351 +0100
+++ gcc/json-parsing.cc 2024-11-20 16:02:18.968119550 +0100
@@ -2024,33 +2024,33 @@ test_parse_number ()

   /* Decimal.  */
   {
-    parser_testcase tc ("3.141");
+    parser_testcase tc ("3.14108");
     ASSERT_EQ (tc.get_error (), nullptr);
     const json::value *jv = tc.get_value ();
     ASSERT_EQ (JSON_FLOAT, jv->get_kind ());
-    ASSERT_EQ (3.141, ((const json::float_number *)jv)->get ());
-    ASSERT_PRINT_EQ (*jv, true, "3.141");
+    ASSERT_EQ (3.14108, ((const json::float_number *)jv)->get ());
+    ASSERT_PRINT_EQ (*jv, true, "3.14108");
     auto range = tc.get_range_for_value (jv);
     ASSERT_TRUE (range);
     ASSERT_RANGE_EQ (*range,
                     0, line_1, 0,
-                    4, line_1, 4);
+                    6, line_1, 6);
   }

   /* Exponents.  */
   {
     {
-      parser_testcase tc ("3.141e+0");
+      parser_testcase tc ("3.14108e+0");
       ASSERT_EQ (tc.get_error (), nullptr);
       const json::value *jv = tc.get_value ();
       ASSERT_EQ (jv->get_kind (), JSON_FLOAT);
-      ASSERT_EQ (as_a <const json::float_number *> (jv)->get (), 3.141);
-      ASSERT_PRINT_EQ (*jv, true, "3.141");
+      ASSERT_EQ (as_a <const json::float_number *> (jv)->get (), 3.14108);
+      ASSERT_PRINT_EQ (*jv, true, "3.14108");
       auto range = tc.get_range_for_value (jv);
       ASSERT_TRUE (range);
       ASSERT_RANGE_EQ (*range,
                       0, line_1, 0,
-                      7, line_1, 7);
+                      9, line_1, 9);
     }
     {
       parser_testcase tc ("42e2");
@@ -2066,17 +2066,17 @@ test_parse_number ()
                       3, line_1, 3);
     }
     {
-      parser_testcase tc ("42e-1");
+      parser_testcase tc ("425e-2");
       ASSERT_EQ (tc.get_error (), nullptr);
       const json::value *jv = tc.get_value ();
       ASSERT_EQ (jv->get_kind (), JSON_FLOAT);
-      ASSERT_EQ (as_a <const json::float_number *> (jv)->get (), 4.2);
-      ASSERT_PRINT_EQ (*jv, true, "4.2");
+      ASSERT_EQ (as_a <const json::float_number *> (jv)->get (), 4.25);
+      ASSERT_PRINT_EQ (*jv, true, "4.25");
       auto range = tc.get_range_for_value (jv);
       ASSERT_TRUE (range);
       ASSERT_RANGE_EQ (*range,
                       0, line_1, 0,
-                      4, line_1, 4);
+                      5, line_1, 5);
     }
   }
 }
changes the current numbers to numbers exactly representable in double (and
float) and passes self-tests on x86_64, but I have no idea if that helps those
who see the ICE or not.

Reply via email to