https://bugs.freedesktop.org/show_bug.cgi?id=109543

--- Comment #10 from Gustaw Smolarczyk <wielkie...@gmail.com> ---
Hi,

After messing for a while with godbolt, it seems like GCC 9 considers literal
scope to end with a block and not a function [1], or at least this is my
assumption. In the godbolt example you can see the "1" assignments being
dropped from the assembly when they are inside the switch scope.

When a literal assignment (like the following in radv_meta_blit.c
build_pipeline function) happens inside a switch case, GCC 9 probably drops it:

--- SNIP ---

switch(aspect) {
case VK_IMAGE_ASPECT_COLOR_BIT:
        vk_pipeline_info.pColorBlendState =
&(VkPipelineColorBlendStateCreateInfo) {
                .sType =
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
                .attachmentCount = 1,
                .pAttachments = (VkPipelineColorBlendAttachmentState []) {
                        { .colorWriteMask =
                        VK_COLOR_COMPONENT_A_BIT |
                        VK_COLOR_COMPONENT_R_BIT |
                        VK_COLOR_COMPONENT_G_BIT |
                        VK_COLOR_COMPONENT_B_BIT },
                }
        };
        break;

--- SNIP ---

You could work this around by giving names to the literals and putting them in
the function scope (not inside any block). As I am not familiar with the C
standard, I am not sure if what GCC 9 assumes is legal or not.


[1] https://godbolt.org/z/wTuMH-

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to