[Bug c++/93589] Template instantiation creates a conversion warning when it should not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #2 from Lokesh Janghel --- >Note your example code does not match the warning message you have in comment >#0. Sorry, I used some reduce test case. here is the correct one: $ g++ -Wconversion test.cpp test.cpp: In instantiation of ‘void print_byte_order(T) [with T = short int]’: test.cpp:12:28: required from here test.cpp:7:8: warning: conversion to ‘short int’ from ‘int’ may alter its value [-Wconversion] val |= (CHAR_BIT * static_cast(i)) << (CHAR_BIT * static_cast(i)); ^ >Does clang warn even in a non-template case? I reduce the test case for non-template: #define CHAR_BIT 8 void print_byte_order( short ) { short val = 0; unsigned i = 1; val |= (CHAR_BIT * static_cast(i)) << (CHAR_BIT * static_cast(i)); } That gives warning in GCC but Clang not.
[Bug c++/93589] New: Template instantiation creates a conversion warning when it should not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 Bug ID: 93589 Summary: Template instantiation creates a conversion warning when it should not Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lokeshjanghel91 at gmail dot com Target Milestone: --- Created attachment 47780 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47780&action=edit Run the attached file with -Wconversion When compiling the attached file, a conversion warning is given if the compiler is GCC. This does not happen with CLANG. $ g++ -Wconversion example.cpp example.cpp: In instantiation of ‘void print_byte_order(T) [with T = short int]’: example.cpp:12:27: required from here example.cpp:7:5: warning: conversion to ‘short int’ from ‘int’ may alter its value [-Wconversion] val |=( 5 * static_cast(i)); ^
[Bug middle-end/89889] worse code compared to clang with alloca()
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89889 --- Comment #3 from Lokesh Janghel --- Is there any target hooks for alloca? Should we do the same like __builtin_alloca_with_align (array allocation) or we assume the problem as a target based (prologue/epilogue optimization) issue?
[Bug target/84762] GCC for PowerPC32 violates the SysV ABI spec for small struct returns
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84762 Lokesh Janghel changed: What|Removed |Added CC||lokeshjanghel91 at gmail dot com --- Comment #15 from Lokesh Janghel --- Created attachment 45639 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45639&action=edit Patch with new option for LSB & MSB
[Bug target/85667] (x86_64) ms_abi rules aren't followed when returning short structs with float values
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667 --- Comment #5 from Lokesh Janghel --- >>I think we should check if type is aggregate before we return in eax and leave xmm0 for float and double. >>break; >>+ case 8: >>+ case 4: >>+ if (valtype != NULL_TREE && AGGREGATE_TYPE_P (valtype)) >>+ break; >>+ if (mode == SFmode || mode == DFmode) >>+ regno = FIRST_SSE_REG; >>+ break; It is working in both targets (x86_64 & mingw-w64). I tested in both targets.