Summary: | [9 Regression] Wrong code since r265463 in tree switch conversion | ||
---|---|---|---|
Product: | gcc | Reporter: | Martin Liška <marxin> |
Component: | tree-optimization | Assignee: | Martin Liška <marxin> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | wrong-code |
Priority: | P1 | ||
Version: | 9.0 | ||
Target Milestone: | 9.0 | ||
See Also: |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84436 https://bugzilla.opensuse.org/show_bug.cgi?id=1121063 |
||
Host: | Target: | ||
Build: | Known to work: | 8.2.0 | |
Known to fail: | 9.0 | Last reconfirmed: | 2019-01-08 00:00:00 |
Description
Martin Liška
2019-01-08 11:15:35 UTC
Mine. Also Mine, also seen in libzip package. Reduced test-case: $ cat zip.c typedef unsigned short int uint16_t; typedef unsigned char uint8_t; uint16_t length; uint16_t enc_method_global; uint8_t __attribute__((noipa)) _zip_buffer_get_8(int buffer) { return buffer; } int __attribute__((noipa)) foo(int v) { uint16_t enc_method; switch (_zip_buffer_get_8(v)) { case 1: enc_method = 0x0101; break; case 2: enc_method = 0x0102; break; case 3: enc_method = 0x0103; break; default: __builtin_abort (); } enc_method_global = enc_method; } int main(int argc, char **argv) { foo (1); if (enc_method_global != 0x0101) __builtin_abort (); return 0; } I'm testing patch for that. Author: marxin Date: Tue Jan 8 14:45:28 2019 New Revision: 267728 URL: https://gcc.gnu.org/viewcvs?rev=267728&root=gcc&view=rev Log: Use proper type in linear transformation in tree-switch-conversion (PR tree-optimization/88753). 2019-01-08 Martin Liska <mliska@suse.cz> PR tree-optimization/88753 * tree-switch-conversion.c (switch_conversion::build_one_array): Come up with local variable constructor. Convert first to type of constructor values. 2019-01-08 Martin Liska <mliska@suse.cz> PR tree-optimization/88753 * gcc.dg/tree-ssa/pr88753.c: New test. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/pr88753.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-switch-conversion.c Fixed. |