I found an obnoxious bug in the C compiler. I would like to help the community by reporting it.
I don't have much familiarity with the CE toolchain or with github, so I don't know quite where to go to report the issue. I did come across a page on the LLVM site for reporting bugs, but to follow the procedure I saw there, apparently I would have to spend hours learning new tools that I've never heard of before. Um, no, after a long day debugging, I don't have time for that!
Is there another way? If I narrow down the bug so that I have source code of a small program that very obviously doesn't compile as it should, does anyone know of an easy way to report the issue?
(I'm including below some details of the compiler bug, in case anyone is curious.)
***
I am using clang version 14.0.0 (https://github.com/jacobly0/llvm-project a139def90d26173f771eb1eca797633d1fbb2797.
When my program runs the following code, it says "Made it through":
Code:
But if I comment out the second line, my program says "WHAT THE @$%&*?":
Code:
That obviously shouldn't be able to happen under any circumstances!
(Yes, index is a local uint8_t that equals 2 when it his this portion of code, and cycle is a pointer that points to a byte that's immediately after a 2. However, other portions of the code may somehow matter; I couldn't quickly duplicate this bug in a much smaller program. If there's a reasonably easy way for me to report this bug, then I will try to narrow it down.)
I don't have much familiarity with the CE toolchain or with github, so I don't know quite where to go to report the issue. I did come across a page on the LLVM site for reporting bugs, but to follow the procedure I saw there, apparently I would have to spend hours learning new tools that I've never heard of before. Um, no, after a long day debugging, I don't have time for that!
Is there another way? If I narrow down the bug so that I have source code of a small program that very obviously doesn't compile as it should, does anyone know of an easy way to report the issue?
(I'm including below some details of the compiler bug, in case anyone is curious.)
***
I am using clang version 14.0.0 (https://github.com/jacobly0/llvm-project a139def90d26173f771eb1eca797633d1fbb2797.
When my program runs the following code, it says "Made it through":
Code:
if (index == *(((uint8_t*)cycle) - 1)) index = 0;
else FailBecause("Never runs this line BUT NEEDS IT!");
if (*(((uint8_t*)cycle) - 1) == 2 && index == 2) FailBecause("WHAT THE @$%&*?");
Say("Made it through");
But if I comment out the second line, my program says "WHAT THE @$%&*?":
Code:
if (index == *(((uint8_t*)cycle) - 1)) index = 0;
// else FailBecause("Never runs this line BUT NEEDS IT!");
if (*(((uint8_t*)cycle) - 1) == 2 && index == 2) FailBecause("WHAT THE @$%&*?");
Say("Made it through");
That obviously shouldn't be able to happen under any circumstances!
(Yes, index is a local uint8_t that equals 2 when it his this portion of code, and cycle is a pointer that points to a byte that's immediately after a 2. However, other portions of the code may somehow matter; I couldn't quickly duplicate this bug in a much smaller program. If there's a reasonably easy way for me to report this bug, then I will try to narrow it down.)