GCC 15 Compiler Development Shifts From Features To Bug Fixing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • phoronix
    Administrator
    • Jan 2007
    • 67091

    GCC 15 Compiler Development Shifts From Features To Bug Fixing

    Phoronix: GCC 15 Compiler Development Shifts From Features To Bug Fixing

    GCC 15 feature development is now officially over with entering stage three development to focus on fixing compiler bugs...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
  • dmalcolm
    Junior Member
    • Jan 2022
    • 13

    #2
    Note that the first part of GCC's stage 3 freeze is traditionally rather "slushy": patches that have already been posted for review may make it into GCC 15, perhaps after a little iteration.

    FWIW I've got a couple myself that I posted last week that I'm hoping to get into GCC 15:

    Comment

    • intelfx
      Senior Member
      • Jun 2018
      • 1083

      #3
      Originally posted by dmalcolm View Post
      Note that the first part of GCC's stage 3 freeze is traditionally rather "slushy": patches that have already been posted for review may make it into GCC 15, perhaps after a little iteration.

      FWIW I've got a couple myself that I posted last week that I'm hoping to get into GCC 15:
      The diagnostics thing looks gorgeous. Is it only for concepts though?

      Comment

      • dmalcolm
        Junior Member
        • Jan 2022
        • 13

        #4
        Originally posted by intelfx View Post

        The diagnostics thing looks gorgeous. Is it only for concepts though?
        Thanks! As well as for concepts, the patch also affects the output for templates in general, and for constexpr. But you'd have to opt-in with -fdiagnostics-set-output=text:experimental-nesting=yes

        Comment

        • cl333r
          Senior Member
          • Oct 2009
          • 2295

          #5
          Originally posted by dmalcolm View Post
          [LIST][*]Improvements to C++ template errors: https://gcc.gnu.org/pipermail/gcc-pa...er/668467.html​; screenshot here
          One of the reasons I avoided templates in C++ at all cost is that if I get an error it's almost impossible to figure out what and where's the problem cause I get 10 pages of random garbage text dumped into the terminal as the compiler's error message. Probably C++'s worst trait.

          Comment

          • DavidBrown
            Senior Member
            • Jan 2016
            • 155

            #6
            Originally posted by cl333r View Post
            One of the reasons I avoided templates in C++ at all cost is that if I get an error it's almost impossible to figure out what and where's the problem cause I get 10 pages of random garbage text dumped into the terminal as the compiler's error message. Probably C++'s worst trait.
            This has always been a challenge for C++, and indeed any language that supports and encourages complex data or control structures. Diagnostics are to help developers find the cause of bugs in their code, and there are no rules for determining whether the bug is at the start of the first level of the hierarchy, or at the last level of the use of it. Sometimes the developer is best served by the highest level, most abstract view - such as calling a type "std::string" - and sometimes by the underlying templates, specialisations and details. Generating good diagnostics that fit what the developer needs at the time is a harder problem than parsing correct code or generating good object code in the compiler.

            One of the aims of adding concepts to C++ was to simplify and clarify diagnostics, and they certainly do help. They can give a kind of a fixed point in the diagnostics - you can have errors before the concept, or after it, but good use of concepts makes it easier to find which side your problem lies on. (They have other advantages too, making code a lot clearer and easier to work with.)

            And there is no doubt that gcc has been much improved here over the years. (I think competition and cooperating with clang had a good influence on them.) And some of the stuff that David Malcolm (and others) has been working on in diagnostics and static error checking is very impressive. Once his structured diagnostic data formats get supported by IDEs, it will really make things easier for developers chasing down their problems.

            So if you have avoided templates in the past due to incomprehensible error messages, maybe it's time to update your tools and revisit them. If not now, then once gcc 15 is released :-)

            Comment

            • cl333r
              Senior Member
              • Oct 2009
              • 2295

              #7
              Originally posted by DavidBrown View Post
              So if you have avoided templates in the past due to incomprehensible error messages, maybe it's time to update your tools and revisit them. If not now, then once gcc 15 is released :-)
              Thanks, I can't run away from C++ anyway cause Qt6 uses it, but I started playing with zig and so far I like it a lot.

              Comment

              • dmalcolm
                Junior Member
                • Jan 2022
                • 13

                #8
                Originally posted by DavidBrown View Post

                So if you have avoided templates in the past due to incomprehensible error messages, maybe it's time to update your tools and revisit them. If not now, then once gcc 15 is released :-)
                Thanks for the kind words.

                Note that the stuff I posted above isn't yet reviewed, and even when it is, it might well be hidden behind a command-line option for GCC 15, since it's such a radical change to how we present diagnostics (I'd love to make it the default, but it needs a lot of "eating my own dogfood" before I can reasonably inflict it on end-users!)



                Comment

                Working...
                X